Esempio n. 1
0
        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;
        }
Esempio n. 2
0
        public void SimulatePanelSwipe(
            ModePanel panel,
            Action betweenSwipeAction           = null,
            Action <ModePanel> afterSwipeAction = null,
            bool newPanelInferior = true)
        {
            if (panel != lastActivePanel)
            {
                Debug.LogError("Cannot simulate panel swipe on the non-active panel.");
                return;
            }

            copyPanel.TakeSnapshot();
            betweenSwipeAction?.Invoke();

            panel.ImmediateStateSet(false);

            panel.LerpHandler.Activate(
                duration: flipTime,
                lerpAction: new ModePanelTranslator(
                    direction: Direction.Show,
                    axis: panelAxis,
                    orientation: newPanelInferior ? Orientation.Inferior : Orientation.Superior),
                finishedCallback: afterSwipeAction);

            copyPanel.FocusAcquired();
            copyPanel.LerpHandler.Activate(
                duration: flipTime,
                lerpAction: new ModePanelTranslator(
                    direction: Direction.Hide,
                    axis: panelAxis,
                    orientation: newPanelInferior ? Orientation.Superior : Orientation.Inferior),
                finishedCallback: DisableModePanel);
        }