From 689e582efd2dc2c1597fb53cbb00bc10ed2e22cf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=9B=A8=E8=90=BD=E9=9A=8F=E9=A3=8E?= Date: Wed, 2 Nov 2022 17:54:46 +0800 Subject: [PATCH] =?UTF-8?q?[fix]=20=E8=A7=A3=E5=86=B3=E7=BC=96=E8=BE=91?= =?UTF-8?q?=E5=99=A8=E6=89=93=E5=8C=85=E6=97=B6=E5=87=BA=E7=8E=B0=E7=9A=84?= =?UTF-8?q?=20=5FserializedObject.targetObject=20=E6=84=8F=E5=A4=96?= =?UTF-8?q?=E9=94=80=E6=AF=81=E7=9A=84=E6=83=85=E5=86=B5=20(#17)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Editor/Settings/HybridCLRSettingProvider.cs | 5 +++++ 1 file changed, 5 insertions(+) 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);