public static HierarchyDebugWindow Initialise(Transform root) { if (root == null) { Debug.LogWarning("Transform passed to HierarchyDebugWindow was null"); return(null); } HierarchyDebugWindow window = HierarchyDebugWindow.GetWindow <HierarchyDebugWindow> (); if (window.m_TreeViewState == null) { window.m_TreeViewState = new TreeViewState(); } window.m_HierarchyTreeView = new HierarchyTreeView(window.m_TreeViewState, root); GUIContent content = new GUIContent(EditorGUIUtility.IconContent("UnityEditor.SceneHierarchyWindow")); content.text = "Debug"; window.titleContent = content; window.Show(); return(window); }
/// <summary> /// Called to open a window containing the hierarchy associated with the object queried /// </summary> public static void Log(Transform transform) { if (transform == null) { Debug.LogWarning("Transform passed to HierarchyDebug was null"); return; } Transform root = GetRoot(transform); HierarchyDebugWindow hDW; if (dict.TryGetValue(root, out hDW)) { //hDW.Focus (); } else { hDW = HierarchyDebugWindow.Initialise(root); if (hDW != null) { dict.Add(root, hDW); } } }