Custom Editor の EditorGUILayout.ObjectField()

 エディタ拡張を行っていたところ…

f:id:Taka8:20170504125415p:plain

‘EditorGUILayout.ObjectField()'は旧形式です。'allowSceneObjects'をチェックしろとVisual Studioに怒られました。

Unity - スクリプトリファレンス: EditorGUILayout.ObjectField

解決法

obj.hoge = EditorGUILayout.ObjectField("説明文", obj.hoge, typeof((型)), true) as (型);

 上記のように記述すると上手くいきました。

参考URL

anchan828.github.io

Multiplayer Networking/Unity/Standard Assets/Nintendo Switch/Asset Store/Git/GitHub for Windows/Arduino/Blender/はてなブログ/