diff --git a/Editor/Settings/HybridCLRSettingProvider.cs b/Editor/Settings/HybridCLRSettingProvider.cs index 7fc0063..f2926c1 100644 --- a/Editor/Settings/HybridCLRSettingProvider.cs +++ b/Editor/Settings/HybridCLRSettingProvider.cs @@ -115,6 +115,11 @@ namespace HybridCLR.Editor { using (CreateSettingsWindowGUIScope()) { + //解决编辑器打包时出现的 _serializedObject.targetObject 意外销毁的情况 + if (_serializedObject == null||!_serializedObject.targetObject) + { + InitGUI(); + } _serializedObject.Update(); EditorGUI.BeginChangeCheck(); EditorGUILayout.PropertyField(_enable);