From bd6ac5f4da8acd87a2e73aa1666995d24f000575 Mon Sep 17 00:00:00 2001 From: chengshengfei Date: Fri, 12 Apr 2024 10:58:06 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E4=BB=A3=E7=A0=81=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../EventInterface/EventInterfaceGenerate.cs | 2 ++ .../GameSettings/SynAssemblysContent.cs | 25 ++++++++++++++++--- .../GameSettings/TEngineSettingsProvider.cs | 2 +- .../Resources/TEngineGlobalSettings.asset | 2 +- .../Core/GameSettings/TEngineSettings.cs | 6 ++--- 5 files changed, 29 insertions(+), 8 deletions(-) diff --git a/UnityProject/Assets/TEngine/Editor/EventInterface/EventInterfaceGenerate.cs b/UnityProject/Assets/TEngine/Editor/EventInterface/EventInterfaceGenerate.cs index 57359e8e..2ebbbb1c 100644 --- a/UnityProject/Assets/TEngine/Editor/EventInterface/EventInterfaceGenerate.cs +++ b/UnityProject/Assets/TEngine/Editor/EventInterface/EventInterfaceGenerate.cs @@ -13,6 +13,7 @@ Example: ************************************************************************************************************/ #endregion +using HybridCLR.Editor.Settings; using System; using System.Collections; using System.Collections.Generic; @@ -92,6 +93,7 @@ public static class EventInterfaceGenerate } } + EditorUtility.SetDirty(HybridCLRSettings.Instance); AssetDatabase.Refresh(); Debug.Log("Generate EventInterface Complete"); // EditorUtility.DisplayDialog("提示", "代码生成完毕", "OK"); diff --git a/UnityProject/Assets/TEngine/Editor/GameSettings/SynAssemblysContent.cs b/UnityProject/Assets/TEngine/Editor/GameSettings/SynAssemblysContent.cs index e5462d94..784a5772 100644 --- a/UnityProject/Assets/TEngine/Editor/GameSettings/SynAssemblysContent.cs +++ b/UnityProject/Assets/TEngine/Editor/GameSettings/SynAssemblysContent.cs @@ -8,9 +8,28 @@ public static class SyncAssemblyContent { public static void RefreshAssembly() { - SettingsUtils.SetHybridCLRHotUpdateAssemblies(HybridCLR.Editor.SettingsUtil.HotUpdateAssemblyFilesIncludePreserved); - SettingsUtils.SetHybridCLRAOTMetaAssemblies(HybridCLR.Editor.SettingsUtil.AOTAssemblyNames); + var hotUpdateAssemblyFiles = HybridCLR.Editor.SettingsUtil.HotUpdateAssemblyFilesIncludePreserved; + var aotAssemblyNames = HybridCLR.Editor.SettingsUtil.AOTAssemblyNames; + + // 检查两个列表是否都为空,如果是,记录日志并返回。 + if (hotUpdateAssemblyFiles.Count == 0 && aotAssemblyNames.Count == 0) + { + Debug.Log("HybridCLR.Editor.SettingsUtil 程序集列表值为空"); + return; + } + + // 如果列表不为空,则更新相应的设置。 + if (hotUpdateAssemblyFiles.Count > 0) + { + SettingsUtils.SetHybridCLRHotUpdateAssemblies(hotUpdateAssemblyFiles); + } + + if (aotAssemblyNames.Count > 0) + { + SettingsUtils.SetHybridCLRAOTMetaAssemblies(aotAssemblyNames); + } + AssetDatabase.Refresh(); AssetDatabase.SaveAssets(); } -} \ No newline at end of file +} diff --git a/UnityProject/Assets/TEngine/Editor/GameSettings/TEngineSettingsProvider.cs b/UnityProject/Assets/TEngine/Editor/GameSettings/TEngineSettingsProvider.cs index f4b8c902..e16d32ff 100644 --- a/UnityProject/Assets/TEngine/Editor/GameSettings/TEngineSettingsProvider.cs +++ b/UnityProject/Assets/TEngine/Editor/GameSettings/TEngineSettingsProvider.cs @@ -58,7 +58,7 @@ public class TEngineSettingsProvider : SettingsProvider m_CustomSettings = GetSerializedSettings(); } - EditorGUILayout.PropertyField(m_CustomSettings.FindProperty("m_BybridCLRCustomGlobalSettings")); + EditorGUILayout.PropertyField(m_CustomSettings.FindProperty("m_HybridCLRCustomGlobalSettings")); EditorGUILayout.Space(20); if (!changeCheckScope.changed) { diff --git a/UnityProject/Assets/TEngine/ResRaw/Resources/TEngineGlobalSettings.asset b/UnityProject/Assets/TEngine/ResRaw/Resources/TEngineGlobalSettings.asset index 9339f529..48f42664 100644 --- a/UnityProject/Assets/TEngine/ResRaw/Resources/TEngineGlobalSettings.asset +++ b/UnityProject/Assets/TEngine/ResRaw/Resources/TEngineGlobalSettings.asset @@ -78,7 +78,7 @@ MonoBehaviour: componentName: AnimationCurve - uiElementRegex: m_canvasGroup componentName: CanvasGroup - m_BybridCLRCustomGlobalSettings: + m_HybridCLRCustomGlobalSettings: m_Enable: 1 HotUpdateAssemblies: - GameBase.dll diff --git a/UnityProject/Assets/TEngine/Runtime/Core/GameSettings/TEngineSettings.cs b/UnityProject/Assets/TEngine/Runtime/Core/GameSettings/TEngineSettings.cs index 29739b52..99db444c 100644 --- a/UnityProject/Assets/TEngine/Runtime/Core/GameSettings/TEngineSettings.cs +++ b/UnityProject/Assets/TEngine/Runtime/Core/GameSettings/TEngineSettings.cs @@ -7,13 +7,13 @@ public class TEngineSettings : ScriptableObject public FrameworkGlobalSettings FrameworkGlobalSettings => m_FrameworkGlobalSettings; - [Header("HybridCLR")] [SerializeField] private HybridCLRCustomGlobalSettings m_BybridCLRCustomGlobalSettings; + [Header("HybridCLR")] [SerializeField] private HybridCLRCustomGlobalSettings m_HybridCLRCustomGlobalSettings; - public HybridCLRCustomGlobalSettings BybridCLRCustomGlobalSettings => m_BybridCLRCustomGlobalSettings; + public HybridCLRCustomGlobalSettings BybridCLRCustomGlobalSettings => m_HybridCLRCustomGlobalSettings; public void Set(FrameworkGlobalSettings globalSettings,HybridCLRCustomGlobalSettings hybridClrCustomGlobalSettings) { m_FrameworkGlobalSettings = globalSettings; - m_BybridCLRCustomGlobalSettings = hybridClrCustomGlobalSettings; + m_HybridCLRCustomGlobalSettings = hybridClrCustomGlobalSettings; } } \ No newline at end of file