From b661da68f2b04989c267b4a08e819eb6212b02f4 Mon Sep 17 00:00:00 2001 From: ALEXTANG <574809918@qq.com> Date: Thu, 14 Dec 2023 10:12:56 +0800 Subject: [PATCH] Update EventInterfaceGenerate.cs --- .../EventInterface/EventInterfaceGenerate.cs | 24 +++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/UnityProject/Assets/TEngine/Editor/EventInterface/EventInterfaceGenerate.cs b/UnityProject/Assets/TEngine/Editor/EventInterface/EventInterfaceGenerate.cs index 936ef566..61adeea5 100644 --- a/UnityProject/Assets/TEngine/Editor/EventInterface/EventInterfaceGenerate.cs +++ b/UnityProject/Assets/TEngine/Editor/EventInterface/EventInterfaceGenerate.cs @@ -31,12 +31,32 @@ public static class EventInterfaceGenerate public const string EventInterfacePath = "Assets/GameScripts/HotFix/GameLogic/Event/Interface/"; + public static bool BOpenAutoGenerate = false; + static EventInterfaceGenerate() { - Generate(); + BOpenAutoGenerate = EditorPrefs.GetBool("EventInterfaceGenerate.BOpenAutoGenerate", true); + if (BOpenAutoGenerate) + { + Generate(); + } } - [MenuItem("TEngine/Generate EventInterface", false, 300)] + [MenuItem("TEngine/EventInterface/OpenAutoGenerate", false, 300)] + public static void OpenAutoGenerate() + { + EditorPrefs.SetBool("EventInterfaceGenerate.BOpenAutoGenerate", true); + Debug.Log("OpenAutoGenerate"); + } + + [MenuItem("TEngine/EventInterface/CloseAutoGenerate", false, 301)] + public static void CloseAutoGenerate() + { + EditorPrefs.SetBool("EventInterfaceGenerate.BOpenAutoGenerate", false); + Debug.Log("CloseAutoGenerate"); + } + + [MenuItem("TEngine/EventInterface/Generate EventInterface", false, 302)] public static void Generate() { if (EventInterfaceGenerateTag.HadGenerate)