/// <summary> /// Convenience method -- add a new panel. /// </summary> static public UIPanelEx AddPanel(GameObject go) { if (go == null) { return(null); } int depth = UIPanelEx.nextUnusedDepth; UIPanelEx panel = NGUITools.AddChild <UIPanelEx>(go); panel.depth = depth; return(panel); }
void Start() { if (panel == null) { panel = this.GetComponentInParent <UIPanelEx>(); } if (panel == null) { // UIPanel p = this.GetComponentInParent<UIPanel>(); // GameObject obj = p.gameObject; // Destroy(p); // panel = obj.AddComponent<UIPanelEx>(); Debug.LogError("使用该脚本,需要有UIPanelEx的父对象"); } else { panel.addUISort(this); } }
void LateUpdate() { // base.LateUpdate(); // Update all draw calls, making them draw in the right order for (int i = 0, imax = list.Count; i < imax; ++i) { //UIPanel p = list[i]; //if(p.GetType()) //{ UIPanelEx p = list[i] as UIPanelEx; if (p) { p.updateUISort(); } // Debug.Log("updateUISort:"+p.GetType()); //} } }
static void AddPanel() { UIPanelEx panel = NGUISettingsEx.AddPanel(NGUIMenu.SelectedRoot()); Selection.activeGameObject = (panel == null) ? NGUIEditorTools.SelectedRoot(true) : panel.gameObject; }
public void initPanel(UIPanelEx p) { panel = p; }