private void OnShowBegun() { try { log.Debug("{0} ShowBegun", name); if (tabs != null && !tabs.initialized) { tabs.Init(this); } SetContents(); SetLayer(); if (tabs != null) { tabs.Open(); } PlayAudio(); if (onShowBegun != null) { onShowBegun(); } } catch (Exception ex) { log.Error(ex); } }
public bool OnInspectorGUI() { bool changed = tabArrInspector.OnInspectorGUI(); changed |= tabPrefabArrInspector.OnInspectorGUI(); if (tabPrefabArrInspector.Length > 0) { changed |= tabButtonArrInspector.Draw(); } if (GUILayout.Button("Reallocate")) { tabHandler.tabs = new UITab[0]; foreach (UITab t in tabHandler.GetComponentsInChildren <UITab>(true)) { tabHandler.tabs = tabHandler.tabs.Add(t); OnTabChanged(t, 0); } EditorUtil.SetDirty(tabHandler); // for (int i=0; i<tabHandler.tabs.Length; ++i) { // UITab t = tabHandler.tabs[i]; // OnTabRemoved(t, 0); // OnTabChanged(t, 0); // } } EditorGUILayout.BeginHorizontal(); EditorGUIUtil.ObjectField <UIButton>(ref button, true); EditorGUILayout.EndHorizontal(); foreach (UITab t in tabHandler.tabs) { if (t != null) { if (t.tabButton == null) { EditorGUILayout.HelpBox(t.name + " Tab Button is null", MessageType.Error); } if (t.uiRoot == null) { EditorGUILayout.HelpBox(t.name + " Tab Root is null", MessageType.Error); } } } HashSet <GameObject> activeTabs = new HashSet <GameObject>(); foreach (UITab t in tabHandler.tabs) { if (t != null && t.IsVisible()) { activeTabs.Add(t.uiRoot); } } if (activeTabs.Count > 1) { EditorGUILayout.HelpBox("Multiple Tabs are activated", MessageType.Error); if (GUILayout.Button("Fix")) { tabHandler.Init(tabHandler); foreach (UITab t in tabHandler.tabs) { if (t != null) { EditorUtil.SetDirty(t.uiRoot); } } } } return(changed); }