From 43ce8036fc3af3a4d69741971ec55d6263a55de9 Mon Sep 17 00:00:00 2001
From: yyl <yyl>
Date: 星期四, 27 八月 2026 10:32:23 +0800
Subject: [PATCH] Merge branch 'master' of http://192.168.1.20:10010/r/Project_SG_client

---
 Assets/Editor/Tool/PrefabCreateTool.cs |   24 ++++++++++++++++--------
 1 files changed, 16 insertions(+), 8 deletions(-)

diff --git a/Assets/Editor/Tool/PrefabCreateTool.cs b/Assets/Editor/Tool/PrefabCreateTool.cs
index 4b1431c..51c7a8e 100644
--- a/Assets/Editor/Tool/PrefabCreateTool.cs
+++ b/Assets/Editor/Tool/PrefabCreateTool.cs
@@ -73,6 +73,14 @@
         return AssetDatabase.LoadAssetAtPath<GameObject>(string.Format("Assets/Editor/UIPattern/{0}.prefab", name));
     }
 
+    public static GameObject CreateUIComp(string sourceName, string name)
+    {
+        var prefab = AssetDatabase.LoadAssetAtPath<GameObject>(string.Format("Assets/ResourcesOut/UIComp/{0}.prefab", sourceName));
+        var instance = GameObject.Instantiate(prefab) as GameObject;
+        instance.name = name;
+        return instance;
+    }
+
     [MenuItem("GameObject/UI/FunctionButton")]
     public static async UniTask CreateFunctionButton()
     {
@@ -116,9 +124,9 @@
     }
 
     [MenuItem("GameObject/UI/ItemCell")]
-    public static async UniTask CreateItemCell()
+    public static void CreateItemCell()
     {
-        var button = await UIUtility.CreateWidget("ItemCell", "ItemCell");
+        var button = CreateUIComp("ItemCell", "ItemCell");
         SetParent(button);
     }
 
@@ -169,9 +177,9 @@
     }
 
     [MenuItem("GameObject/UI/閫氱敤鎸夐挳")]
-    public static async UniTask CreateButtonEx()
+    public static void CreateButtonEx()
     {
-        var button = await UIUtility.CreateWidget("CommonButton", "CommonButton");
+        var button = CreateUIComp("CommonButton", "CommonButton");
         var buttonEx = button.GetComponent<ButtonEx>();
         buttonEx.interval = 0.1f;
         buttonEx.pressedScale = 1.05f;
@@ -179,9 +187,9 @@
     }
 
     [MenuItem("GameObject/UI/绾㈢偣")]
-    public static async UniTask CreateRedPoint()
+    public static void CreateRedPoint()
     {
-        var button = await UIUtility.CreateWidget("RedPoint", "RedPoint");
+        var button = CreateUIComp("RedPoint", "RedPoint");
         SetParent(button);
     }
 
@@ -195,9 +203,9 @@
     }
 
     [MenuItem("GameObject/UI/浜岀骇甯﹀姛鑳芥")]
-    public static async UniTask CreateSecondLevelWin()
+    public static void CreateSecondLevelWin()
     {
-        var prefab = await UIUtility.CreateWidget("SecondLevelWin", "Panel");
+        var prefab = CreateUIComp("SecondLevelWin", "Panel");
         SetParent(prefab);
         var rectTransform = prefab.GetComponent<RectTransform>();
         // 瀹屽叏濉厖鐖跺鍣�

--
Gitblit v1.8.0