Example #1
0
    private bool OnNavigateBack()
    {
        UnityEngine.Debug.Log("navigating back!");
        if (!this.m_DoneButton.m_button.activeSelf)
        {
            return(false);
        }
        foreach (GameObject obj2 in this.m_RewardObjects)
        {
            if (obj2 != null)
            {
                PlayMakerFSM rfsm = obj2.GetComponent <PlayMakerFSM>();
                if (rfsm != null)
                {
                    rfsm.SendEvent("Death");
                }
                foreach (UberText text in obj2.GetComponentsInChildren <UberText>())
                {
                    object[] args = new object[] { "alpha", 0f, "time", 0.8f, "includechildren", true, "easetype", iTween.EaseType.easeInOutCubic };
                    iTween.FadeTo(text.gameObject, iTween.Hash(args));
                }
                RewardCard componentInChildren = obj2.GetComponentInChildren <RewardCard>();
                if (componentInChildren != null)
                {
                    componentInChildren.Death();
                }
            }
        }
        SceneUtils.EnableColliders(this.m_DoneButton.gameObject, false);
        this.m_DoneButton.RemoveEventListener(UIEventType.RELEASE, new UIEvent.Handler(this.OnDoneButtonPressed));
        Spell component = this.m_DoneButton.m_button.GetComponent <Spell>();

        component.AddFinishedCallback(new Spell.FinishedCallback(this.OnDoneButtonHidden));
        component.ActivateState(SpellStateType.DEATH);
        CollectionManager.Get().RemoveAchievesCompletedListener(new CollectionManager.DelOnAchievesCompleted(this.OnCollectionAchievesCompleted));
        if (this.m_addRewardsToCacheValues)
        {
            this.AddRewardsToCacheValues();
        }
        return(true);
    }