NullReferenceException: Object reference not set to an instance of an object UnityEditor.PropertyHandler.OnGUILayout (UnityEditor.SerializedProperty property, UnityEngine.GUIContent label, System.Boolean includeChildren, UnityEngine.GUILayoutOption[] options) (at <df1a03ec30c146379d803c850c515d48>:0) UnityEditor.EditorGUILayout.PropertyField (UnityEditor.SerializedProperty property, UnityEngine.GUIContent label, System.Boolean includeChildren, UnityEngine.GUILayoutOption[] options) (at <df1a03ec30c146379d803c850c515d48>:0) UnityEditor.EditorGUILayout.PropertyField (UnityEditor.SerializedProperty property, System.Boolean includeChildren, UnityEngine.GUILayoutOption[] options) (at <df1a03ec30c146379d803c850c515d48>:0) MicroDisplayOriginListEditor.OnInspectorGUI () (at Assets/MicroModelDisplay/_Scripts/0_UpdateScripts/4_AllScripts/MicroDisplayOriginListEditor.cs:22)
时间: 2024-03-30 22:35:12 浏览: 464
未将对象引用设置到对象的实例 (System.NullReferenceException)
5星 · 资源好评率100%
这个错误是因为在Unity编辑器中,某个脚本中的SerializedProperty没有被正确地实例化,导致在调用EditorGUILayout.PropertyField时发生了异常。你可以检查这个脚本的代码,看看是否有SerializedProperty未被正确地赋值或初始化,或者是否有其他代码影响了SerializedProperty的值。同时,你也可以尝试重新打开Unity编辑器并重新导入相关文件以解决此问题。
阅读全文