Exemplo n.º 1
0
    //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    //	* Derived Method: On Trigger
    //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    protected override void OnTrigger()
    {
        base.OnTrigger();
        m_oMenuLabelDisplay.ApplyEffects(m_rMenuTextLabel);
        if (GameManager.CurrentSubscene != null)
        {
            GameManager.CurrentSubscene.HideSubscene();
        }
        else if (ObjectTransitionAnimation.CurrentlyActive != null && !ObjectTransitionAnimation.CurrentlyActive.IsLocked)
        {
            ObjectTransitionAnimation.CurrentlyActive.Disappear();
        }
        else
        {
            if (SettingsMenuManager.Opened)
            {
                ShowUnpressedSprite();
                SettingsMenuManager.Close();
            }
            else
            {
                ShowPressedSprite();
                SettingsMenuManager.Open();

                m_oExitLabelDisplay.ApplyEffects(m_rMenuTextLabel);
            }
        }
    }
    //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    //	* New Method: On Disappeared
    //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    protected virtual void OnDisappeared()
    {
        // Once Disappeared, this note is no longer active
        m_bOpened = false;
        if (m_bAssignToSettingsButton && sm_rCurrentlyActiveNotes == this)
        {
            sm_rCurrentlyActiveNotes = null;
        }

        this.enabled = false;
        this.gameObject.SetActive(false);

        // Reactivate Player Input
        ButtonManager.ToggleAllButtons(true);
        TambourineShakeDetector.CheckForShake = true;

        // If we came from the Settings Menu, make it open up once again
        if (m_bShowSettingsMenuOnClose && SettingsMenuManager.Available)
        {
            SettingsMenuManager.Open();
        }
        SettingsMenuManager.UpdateMenuLabel();
    }
    //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    //	* Derived Method: On Disappeared
    //----------------------------------------------------
    //	: Pretty much the exact same as the base version
    //	  of this function. Except that the player input
    //	  is only reactivated if there is no other note
    //	  to display.
    //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    protected override void OnDisappeared()
    {
        sm_rCurrentlyActiveNotes = null;
        m_bOpened = false;

        this.gameObject.SetActive(false);
        if (m_rTransitioningNote != null)
        {
            m_rTransitioningNote.Reveal();
        }
        else
        {
            TambourineShakeDetector.CheckForShake = true;
            if (m_bShowSettingsMenuOnClose && SettingsMenuManager.Available)
            {
                SettingsMenuManager.Open();
            }
            else
            {
                ButtonManager.ToggleAllButtons(true);
            }
        }
    }