From 4b25281b33f386b8c86b32340b684ae34402f7e5 Mon Sep 17 00:00:00 2001 From: hch <305670599@qq.com> Date: 星期四, 09 十月 2025 15:45:43 +0800 Subject: [PATCH] 257 子 【配套功能】新手引导 / 【常规】引导 --- Main/Utility/UIUtility.cs | 36 ++++++++++++++++++------------------ 1 files changed, 18 insertions(+), 18 deletions(-) diff --git a/Main/Utility/UIUtility.cs b/Main/Utility/UIUtility.cs index f4fbbb2..1ae82d0 100644 --- a/Main/Utility/UIUtility.cs +++ b/Main/Utility/UIUtility.cs @@ -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