private void Update()
    {
        if (Input.GetKeyDown("escape"))
        {
            if (this.m_backActionStack.get_Count() == 0)
            {
                return;
            }
            BackActionData backActionData = this.m_backActionStack.Peek();
            switch (backActionData.m_backAction)
            {
            case BackAction.hideAllPopups:
                AllPopups.instance.HideAllPopups();
                break;

            case BackAction.hideSliderPanel:
                if (backActionData.m_backActionTarget != null)
                {
                    SliderPanel component = backActionData.m_backActionTarget.GetComponent <SliderPanel>();
                    if (component != null)
                    {
                        component.HideSliderPanel();
                    }
                }
                break;

            case BackAction.hideMissionResults:
                AllPanels.instance.m_missionResultsPanel.HideMissionResults();
                break;
            }
        }
    }
    public void PushBackAction(BackAction backAction, GameObject backActionTarget = null)
    {
        BackActionData backActionData = default(BackActionData);

        backActionData.m_backAction       = backAction;
        backActionData.m_backActionTarget = backActionTarget;
        this.m_backActionStack.Push(backActionData);
    }
Example #3
0
    public void PushBackAction(BackAction backAction, GameObject backActionTarget = null)
    {
        BackActionData item = default(BackActionData);

        item.m_backAction       = backAction;
        item.m_backActionTarget = backActionTarget;
        this.m_backActionStack.Push(item);
    }