public void ImmediatePanelSet(ModePanel newPanel) { if (lastActivePanel == newPanel) { //Cleanup panel newPanel.FocusLost(); //Reprepare panel newPanel.FocusAcquired(); return; } else if (!animationControlOrderMap.ContainsKey(newPanel)) { Debug.LogError("Error: Panel Not included in initialization array."); return; } newPanel.gameObject.SetActive(true); lastActivePanel.FocusLost(); lastActivePanel.ImmediateStateSet(false); newPanel.FocusAcquired(); newPanel.ImmediateStateSet(true); lastActivePanel.gameObject.SetActive(false); lastActivePanel = newPanel; }
protected void SetPanelActive(ModePanel newPanel, bool newPanelInferior) { if (lastActivePanel == newPanel) { //Cleanup panel newPanel.FocusLost(); //Reprepare panel newPanel.FocusAcquired(); return; } if (!animationControlOrderMap.ContainsKey(newPanel)) { Debug.LogError("Error: Panel Not included in initialization array."); return; } newPanel.gameObject.SetActive(true); lastActivePanel.FocusLost(); newPanel.LerpHandler.Activate( duration: flipTime, lerpAction: new ModePanelTranslator( direction: Direction.Show, axis: panelAxis, orientation: newPanelInferior ? Orientation.Inferior : Orientation.Superior)); lastActivePanel.LerpHandler.Activate( duration: flipTime, lerpAction: new ModePanelTranslator( direction: Direction.Hide, axis: panelAxis, orientation: newPanelInferior ? Orientation.Superior : Orientation.Inferior), finishedCallback: DisableModePanel); newPanel.FocusAcquired(); lastActivePanel = newPanel; }