private static void DestroyHierarchy(HierarchyNode parentNode) { Object.Destroy(parentNode.guiElement); foreach (HierarchyNode childNode in parentNode.nodeList) { IAHierarchy.DestroyHierarchy(childNode); } }
public static void Init(GameObject initObject = null) { if (initObject != null) { IAHierarchy.instance.selectedObject = initObject; } IAHierarchy.Objects.hierarchyTransform = GameObject.Find("CVS_IAHierarchy").transform; IAHierarchy.Objects.viewportContentTransform = IAHierarchy.Objects.hierarchyTransform.Find("Scroll View/Viewport/Content"); IAHierarchy.rootNode = IAHierarchy.GetRootNode(); IAHierarchy.BuildHierarchy(IAHierarchy.rootNode); IAHierarchy.Rendering.RenderGUITree(IAHierarchy.rootNode); GameObject.Find("CVS_IAHierarchy").SetActive(false); }
private static void BuildHierarchy(HierarchyNode parentNode, int i = 0) { GameObject gameObject = parentNode.gameObject; i++; foreach (Transform child in gameObject.transform) { if (!child.name.Contains("HighlightModel")) { HierarchyNode childNode = new HierarchyNode(child.gameObject, i, parentNode); parentNode.AddNode(childNode); IAHierarchy.BuildHierarchy(childNode, i); } } }
void Start() { IAHierarchy.instance = this; IAHierarchy.Init(); }