C#– category –
-
C#
【Unity】値が変わった時にUnityEditorを一時停止する
概要 ObserveEveryValueChangedを使うと、値の変動を検知して処理を差し込むことができます。 今回はthisのlocalPosition.xが1になった時、実行中のUnityEditorを一時停止します。 環境 OSX El Capitan v10.11.4 Unity v5.3.5f1 コード using UniRx; Start... -
C#
【Unity】PrefabをGameObject.Instantiate(Resources.Load())で読み込もうとして、ArgumentException: The thing you want to instantiate is null.
今日のエラー prefabをロードしようとすると、返り値がNullになった。 さらにNullから参照しようとしたため、Object reference not set to an instance of an object エラーとなった。 コード GameObject go = Instantiate(Resources.Load ("hoge")as Game... -
C#
【Unity】二次元配列の初期化でIndexOutOfRangeException
今日のエラー 二次元配列をこのような形で初期化したところ、data[1, 1]を読もうとすると IndexOutOfRangeException: Array index is out of range. となった。 コード int[,] data = new int[,] { { 0 }, { 2, 2 ,2 }, { 1, 100 }, { 100, -1 , 2} }; 原...
12
