diff --git a/Assets/DemoGame/GameScript/Hotfix/UI.meta b/Assets/DemoGame/GameScript/Hotfix/UI.meta index 43b4dfd..760ac8e 100644 --- a/Assets/DemoGame/GameScript/Hotfix/UI.meta +++ b/Assets/DemoGame/GameScript/Hotfix/UI.meta @@ -1,3 +1,8 @@ -fileFormatVersion: 2 -guid: a798f7d3bd41482e8a7315550d8fe3bb -timeCreated: 1721006032 \ No newline at end of file +fileFormatVersion: 2 +guid: 26159df8fe6ea2c48a8a17dd6cbbdc9d +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/DemoGame/GameScript/Hotfix/UI/AssemblyManager.cs b/Assets/DemoGame/GameScript/Hotfix/UI/AssemblyManager.cs new file mode 100644 index 0000000..efa0c43 --- /dev/null +++ b/Assets/DemoGame/GameScript/Hotfix/UI/AssemblyManager.cs @@ -0,0 +1,30 @@ +using System; +using System.Collections.Generic; +using Sirenix.Utilities; + +namespace ZC +{ + public static class AssemblyManager + { + private static List _types; + + public static void Initialize() + { + var types = typeof(AssemblyManager).Assembly.GetTypes(); + _types = new List(types); + } + + public static void GetTypesInhertType(Type baseType, List<(Type, T)> types) where T : Attribute + { + foreach (var type in _types) + { + if (!baseType.IsAssignableFrom(type)) + continue; + var attribute = type.GetCustomAttribute(); + if (attribute == null) + continue; + types.Add((type, attribute)); + } + } + } +} \ No newline at end of file diff --git a/Assets/DemoGame/GameScript/Hotfix/UI/AssemblyManager.cs.meta b/Assets/DemoGame/GameScript/Hotfix/UI/AssemblyManager.cs.meta new file mode 100644 index 0000000..137b43c --- /dev/null +++ b/Assets/DemoGame/GameScript/Hotfix/UI/AssemblyManager.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: db72c038a608450b86ea74714730cdbe +timeCreated: 1712243832 \ No newline at end of file diff --git a/Assets/DemoGame/GameScript/Hotfix/UI/IUI.cs b/Assets/DemoGame/GameScript/Hotfix/UI/IUI.cs new file mode 100644 index 0000000..6e9ae09 --- /dev/null +++ b/Assets/DemoGame/GameScript/Hotfix/UI/IUI.cs @@ -0,0 +1,19 @@ +using UnityEngine; + +namespace ZC +{ + public interface IUI + { + bool isPause { get; } + bool isActive { get; } + GameObject self { get; } + + void Init(); + void Open(); + void Update(float dateTime); + void Close(); + void Pause(); + void Resume(); + void Dispose(); + } +} \ No newline at end of file diff --git a/Assets/DemoGame/GameScript/Hotfix/UI/IUI.cs.meta b/Assets/DemoGame/GameScript/Hotfix/UI/IUI.cs.meta new file mode 100644 index 0000000..4958e0d --- /dev/null +++ b/Assets/DemoGame/GameScript/Hotfix/UI/IUI.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 9578a65c4319423e84d612d3bf472a9e +timeCreated: 1712025643 \ No newline at end of file diff --git a/Assets/DemoGame/GameScript/Hotfix/UI/IUIManager.cs b/Assets/DemoGame/GameScript/Hotfix/UI/IUIManager.cs new file mode 100644 index 0000000..069ae25 --- /dev/null +++ b/Assets/DemoGame/GameScript/Hotfix/UI/IUIManager.cs @@ -0,0 +1,22 @@ +using System.Collections.Generic; +using TMPro; +using UnityEngine; + +namespace ZC +{ + public interface IUIManager + { + TMP_FontAsset font { get; set; } + IUI CreateUI(UIType uiType, string path, UILayer uiLayer); + + IUI ShowUI(UIType uiType); + + T GetUI(UIType uiType) where T : UIBase; + + bool HideUI(UIType uiType); + + IUI CloseLast(); + + void CloseAll(); + } +} \ No newline at end of file diff --git a/Assets/DemoGame/GameScript/Hotfix/UI/IUIManager.cs.meta b/Assets/DemoGame/GameScript/Hotfix/UI/IUIManager.cs.meta new file mode 100644 index 0000000..bba9a38 --- /dev/null +++ b/Assets/DemoGame/GameScript/Hotfix/UI/IUIManager.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 00fd583eb08d477f9c5c2c72ff8721e8 +timeCreated: 1712025554 \ No newline at end of file diff --git a/Assets/DemoGame/GameScript/Hotfix/UI/Logic.meta b/Assets/DemoGame/GameScript/Hotfix/UI/Logic.meta new file mode 100644 index 0000000..232bbd0 --- /dev/null +++ b/Assets/DemoGame/GameScript/Hotfix/UI/Logic.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: fdc33b6bb92f4da98bde09c49e21be36 +timeCreated: 1712381775 \ No newline at end of file diff --git a/Assets/DemoGame/GameScript/Hotfix/UI/Logic/GameUI.cs b/Assets/DemoGame/GameScript/Hotfix/UI/Logic/GameUI.cs new file mode 100644 index 0000000..a6fcf6f --- /dev/null +++ b/Assets/DemoGame/GameScript/Hotfix/UI/Logic/GameUI.cs @@ -0,0 +1,48 @@ +using UnityEngine.UI; +using ZGame; + +namespace ZC +{ + [UIType(UIType.GameUI)] + public class GameUI : UIBase + { + private Button btnLoad1; + private Button btnLoad2; + private Button btnDelete1; + private Button btnDelete2; + + public override void Init() + { + base.Init(); + btnLoad1 = self.transform.FindChildDeep