Unity・3DCG技術ブログ

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

2019-08-15から1日間の記事一覧

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

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