2022-09-08から1日間の記事一覧
概要 C# 9.0 までは引数なしコンストラクタを定義できないため 構造体のフィールドに初期値を設定できない 代替案としてフィールドを nullable にして プロパティの getter でフィールドが null なら初期値を設定する方法がある using UnityEngine; public s…
概要 using UnityEngine; public class Example : MonoBehaviour { private void Update() { // GC Alloc が 31.2 KB for ( var i = 0; i < 1000; i++ ) { var strings = new string[ 0 ]; } } } using System; using UnityEngine; public class Example : M…
ソースコード using System.Diagnostics; using System.IO; using UnityEditor; namespace Kogane.Internal { internal static class ShowProjectInExplorer { #if UNITY_EDITOR_WIN [MenuItem( "File/Show Project in Explorer" )] #else [MenuItem( "File/…