Ejemplo n.º 1
0
    /// <summary>
    /// Update this instance.
    /// </summary>
    protected override void Update()
    {
        base.Update();

        // Check escape input
        if (Input.GetKeyDown(KeyCode.Escape))
        {
            // If credits UI or reset dialog is shown, hide it
            if (m_settingsUI.IsCreditsShown())
            {
                m_settingsUI.BackFromCredits();
            }
            else if (m_settingsUI.IsResetDialogShown())
            {
                m_settingsUI.BackFromResetDialog();
            }
            // Else, return to the Main Menu scene
            else
            {
                Main.Instance.NotifySwitchScene(SceneInfo.SceneEnum.MAIN_MENU);
            }
        }
    }