void UpdatePath() { MakeGuide makeGuide = (MakeGuide)target; List <GuideUI> guideList = makeGuide.guideList; foreach (GuideUI guideUI in guideList) { if (guideUI.go != null) { guideUI.hierarchyPath = GetHierarchyPath(guideUI.go.transform); } } }
string GetInspectorInfo() { string content = ""; MakeGuide makeGuide = (MakeGuide)target; List <GuideUI> guideList = makeGuide.guideList; foreach (GuideUI guideUI in guideList) { if (guideUI.go != null) { content += guideUI.hierarchyPath + "\r\n"; } } return(content); }
void Load() { filePath = EditorUtility.OpenFilePanel("读取文件(.csv)", Application.dataPath, "csv"); string content = File.ReadAllText(filePath); string[] paths = content.Split(new string[] { "\r\n" }, System.StringSplitOptions.RemoveEmptyEntries); MakeGuide makeGuide = (MakeGuide)target; makeGuide.guideList = new List <GuideUI>(); Transform canvasTra = GameObject.Find("Canvas").transform; foreach (string path in paths) { GameObject go = canvasTra.Find(path).gameObject; makeGuide.guideList.Add(new GuideUI(go, path)); } }