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..


相关推荐