Problem When use "Custom Editor" and "Property Drawers" The Same Time

来源:互联网 发布:微信朋友圈发淘宝链接 编辑:程序博客网 时间:2024/06/06 10:04
When you use "Custom Editor" for a custom class (Mark as A,Use DrawDefaultInspector () in OnInspectorGUI()), And the class contain a list of other class(Mark as B) which will use custom property Drawers.It will run to a problem.The list property of class A will pass to the onGui function of the B's property Drawers too.So if  you use the function FindPropertyRelative in the custom property Drawers.you will get a NullReferenceException.It maybe a bug of unity.you can use "property.isArray" to ignore the exception input of onGui of custom property Drawers..
0 0
原创粉丝点击