private void ResetDepth(Transform t) { TutorialEmphasizeUI.DepthInfo depthInfo = this.originalDepths.SingleOrDefault((TutorialEmphasizeUI.DepthInfo x) => x.uiTransform == t); if (depthInfo != null) { this.ChangeDepth(t.GetComponent <UIWidget>(), t.GetComponent <UIPanel>(), depthInfo.widget, depthInfo.panel); for (int i = 0; i < t.childCount; i++) { this.ResetDepth(t.GetChild(i)); } } this.originalDepths.Remove(depthInfo); }
private void SetDepth(Transform t, int newWidgetDepth, int newPanelDepth) { UIWidget component = t.GetComponent <UIWidget>(); UIPanel component2 = t.GetComponent <UIPanel>(); TutorialEmphasizeUI.DepthInfo depthInfo = new TutorialEmphasizeUI.DepthInfo { uiTransform = t, widget = ((!(null != component)) ? 0 : component.depth), panel = ((!(null != component2)) ? 0 : component2.depth) }; this.originalDepths.Add(depthInfo); int newWidgetDepth2 = newWidgetDepth + ((depthInfo.widget >= 0) ? depthInfo.widget : 0); int newPanelDepth2 = newPanelDepth + ((depthInfo.panel >= 0) ? depthInfo.panel : 0); this.ChangeDepth(component, component2, newWidgetDepth2, newPanelDepth2); for (int i = 0; i < t.childCount; i++) { this.SetDepth(t.GetChild(i), newWidgetDepth, newPanelDepth); } }