From dc7922d80c1d133b6261b8af1d521567d2c0a35d Mon Sep 17 00:00:00 2001
From: hch <305670599@qq.com>
Date: 星期四, 30 十月 2025 16:51:39 +0800
Subject: [PATCH] Merge branch 'master' of http://mobile.secondworld.net.cn:10010/r/Project_SG_scripts
---
Main/Utility/UIUtility.cs | 38 +++++++++++++++++++-------------------
1 files changed, 19 insertions(+), 19 deletions(-)
diff --git a/Main/Utility/UIUtility.cs b/Main/Utility/UIUtility.cs
index 27be3a0..1ae82d0 100644
--- a/Main/Utility/UIUtility.cs
+++ b/Main/Utility/UIUtility.cs
@@ -11,7 +11,7 @@
public static GameObject CreateWidget(string _sourceName, string _name)
{
- var prefab = ResManager.Instance.LoadAsset<GameObject>("UIComp", _sourceName);
+ var prefab = UILoader.LoadPrefab(_sourceName);
if (prefab == null)
{
return null;
@@ -310,24 +310,6 @@
vertexHelper.AddTriangle(currentVertCount, currentVertCount + 1, currentVertCount + 2);
}
- // public static string GetUIElementRelativePath(UIRoot _root, Transform _transform)
- // {
- // List<Transform> parents = new List<Transform>() { _transform };
- // GetParents(_transform, ref parents);
-
- // if (parents.Contains(_root.transform))
- // {
- // parents.Remove(_root.transform);
- // }
-
- // var names = new string[parents.Count];
- // for (int i = 0; i < names.Length; i++)
- // {
- // names[i] = parents[i].gameObject.name;
- // }
-
- // return string.Join("/", names);
- // }
public static void GetParents(Transform _transform, ref List<Transform> _parents)
{
@@ -344,4 +326,22 @@
}
}
+ public static string GetUIElementRelativePath(Transform _root, Transform _transform)
+ {
+ List<Transform> parents = new List<Transform>() { _transform };
+ GetParents(_transform, ref parents);
+
+ if (parents.Contains(_root))
+ {
+ parents.Remove(_root);
+ }
+
+ var names = new string[parents.Count];
+ for (int i = 0; i < names.Length; i++)
+ {
+ names[i] = parents[i].gameObject.name;
+ }
+
+ return string.Join("/", names);
+ }
}
--
Gitblit v1.8.0