public void SetWindowState(WindowState state, ShowPanelMode mode = ShowPanelMode.Hierarchy) { ModePanel newPanel = GetModePanel(state); if (newPanel != null) { currentWindowState = state; panelManager.SetPanelActive(newPanel, mode); } }
public void SetPanelActive(ModePanel newPanel, ShowPanelMode mode = ShowPanelMode.Hierarchy) { bool newPanelInferior = false; switch (mode) { case ShowPanelMode.Hierarchy: newPanelInferior = animationControlOrderMap[lastActivePanel] < animationControlOrderMap[newPanel]; break; case ShowPanelMode.Push: case ShowPanelMode.PushClone: newPanelInferior = true; break; case ShowPanelMode.Pop: case ShowPanelMode.PopClone: newPanelInferior = false; break; case ShowPanelMode.Immediate: //No setup necessary break; default: newPanelInferior = true; Debug.LogError($"Unrecognized ShowPanelMode: {mode}"); break; } switch (mode) { case ShowPanelMode.Hierarchy: case ShowPanelMode.Push: case ShowPanelMode.Pop: SetPanelActive(newPanel, newPanelInferior); break; case ShowPanelMode.PushClone: case ShowPanelMode.PopClone: SpecialSetPanelActive(newPanel, newPanelInferior); break; case ShowPanelMode.Immediate: ImmediatePanelSet(newPanel); break; default: Debug.LogError($"Unrecognized ShowPanelMode: {mode}"); break; } }