private void CreateTree(UI_TreeView tvroot) { if (Object.op_Equality((Object)null, (Object)this.minmax)) { this.minmax = (Toggle)((Component)this).get_gameObject().GetComponent <Toggle>(); } if (Object.op_Implicit((Object)this.minmax)) { // ISSUE: method pointer ((UnityEvent <bool>) this.minmax.onValueChanged).AddListener(new UnityAction <bool>((object)this, __methodptr(MinMaxChange))); } this.tvRoot = tvroot; IEnumerator enumerator = ((Component)this).get_gameObject().get_transform().GetEnumerator(); try { while (enumerator.MoveNext()) { UI_TreeView component = (UI_TreeView)((Component)enumerator.Current).get_gameObject().GetComponent <UI_TreeView>(); if (!Object.op_Equality((Object)null, (Object)component)) { this.lstChild.Add(component); component.CreateTree(tvroot); } } } finally { if (enumerator is IDisposable disposable) { disposable.Dispose(); } } }
private void ChangeExpandOrCollapseLoop(bool expand) { if (Object.op_Implicit((Object)this.minmax)) { this.minmax.set_isOn(expand); } IEnumerator enumerator = ((Component)this).get_gameObject().get_transform().GetEnumerator(); try { while (enumerator.MoveNext()) { UI_TreeView component = (UI_TreeView)((Component)enumerator.Current).get_gameObject().GetComponent <UI_TreeView>(); if (!Object.op_Equality((Object)null, (Object)component)) { component.ChangeExpandOrCollapseLoop(expand); } } } finally { if (enumerator is IDisposable disposable) { disposable.Dispose(); } } }
public void UpdateView(ref float totalPosY, float parentPosY) { float parentPosY1 = totalPosY; if (this.rootFlag) { totalPosY = -this.topMargin; } else { RectTransform component = (RectTransform)((Component)this).get_gameObject().GetComponent <RectTransform>(); if (Object.op_Implicit((Object)component)) { component.set_anchoredPosition(new Vector2((float)component.get_anchoredPosition().x, totalPosY - parentPosY)); if (((Component)this).get_gameObject().get_activeSelf() && !this.unused) { totalPosY -= (float)component.get_sizeDelta().y; } } } IEnumerator enumerator = ((Component)this).get_gameObject().get_transform().GetEnumerator(); try { while (enumerator.MoveNext()) { Transform current = (Transform)enumerator.Current; UI_TreeView component = (UI_TreeView)((Component)current).get_gameObject().GetComponent <UI_TreeView>(); if (!Object.op_Equality((Object)null, (Object)component)) { if (!((Component)this).get_gameObject().get_activeSelf() || component.unused) { ((Component)current).get_gameObject().SetActive(false); } else if (Object.op_Implicit((Object)this.minmax)) { ((Component)current).get_gameObject().SetActive(this.minmax.get_isOn()); } component.UpdateView(ref totalPosY, parentPosY1); } } } finally { if (enumerator is IDisposable disposable) { disposable.Dispose(); } } if (!this.rootFlag || !Object.op_Implicit((Object)this.rtScroll)) { return; } this.rtScroll.set_sizeDelta(new Vector2((float)this.rtScroll.get_sizeDelta().x, -totalPosY + this.bottomMargin)); if (!Object.op_Implicit((Object)this.scrollRect)) { return; } ((Behaviour)this.scrollRect).set_enabled(false); ((Behaviour)this.scrollRect).set_enabled(true); }