Unity・3DCG技術ブログ

TAもどきによるUnity・3DCGに関する記事をアップします。

リフレクション

Unityでファイルの特定の行数にジャンプする

概要 Unityでコンソールウィンドウの行をダブルクリックしたときにコードにジャンプしますが それと同じことをUnityのインターナルなメソッドを呼ぶことでできるのでメモ コード static void OpenFileOnSpecificLineAndColumn(string filePath, int line, in…

C#リフレクションでComponentのSerializeFieldをゲットする

// SerializeFieldをゲットする。componentはなんらかのComponentを指定する。 var fields = component.GetType() .GetFields(BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.FlattenHierarchy) .SelectMany(x => x.CustomAttributes.Where…