Exemplo n.º 1
0
 private void Stop()
 {
     foreach (SharedApNotes sharedApNotes in this.apNotes)
     {
         sharedApNotes.StopUpAnimation();
         sharedApNotes.StopDownAnimation();
     }
     for (int j = 0; j < this.apNotes.Length; j++)
     {
         bool active = j < this.currentAp;
         this.apNotes[j].icon.gameObject.SetActive(active);
     }
     this.StopSelectAnimation();
     this.state = BattleUIMultiSharedAP.State.None;
     this.timer = 0f;
 }
Exemplo n.º 2
0
    public void Play(int nextAp, Action callback = null)
    {
        this.Stop();
        this.animationDataList.Clear();
        int num = nextAp - this.currentAp;

        if (num > 0)
        {
            for (int i = 0; i < this.apNotes.Length; i++)
            {
                SharedApNotes apNote = this.apNotes[i];
                if (this.currentAp <= i && i < nextAp)
                {
                    BattleUIMultiSharedAP.AnimationData animationData = new BattleUIMultiSharedAP.AnimationData();
                    animationData.action = delegate()
                    {
                        apNote.icon.gameObject.SetActive(true);
                        apNote.PlayUpAnimation();
                        SoundPlayer.PlayBattleRecoverAPSE();
                    };
                    animationData.check = (() => apNote.isAnimation);
                    this.animationDataList.Add(animationData);
                }
            }
        }
        else
        {
            for (int j = this.apNotes.Length - 1; j >= 0; j--)
            {
                SharedApNotes apNote = this.apNotes[j];
                if (nextAp <= j && j < this.currentAp)
                {
                    BattleUIMultiSharedAP.AnimationData animationData2 = new BattleUIMultiSharedAP.AnimationData();
                    animationData2.action = delegate()
                    {
                        apNote.icon.gameObject.SetActive(true);
                        apNote.PlayDownAnimation();
                    };
                    animationData2.check = (() => apNote.isAnimation);
                    this.animationDataList.Add(animationData2);
                }
            }
        }
        this.currentAp    = nextAp;
        this.apLabel.text = string.Concat(new object[]
        {
            "[FFF000]",
            this.currentAp,
            "[-]/",
            16
        });
        if (this.currentAp != 16)
        {
            this.apMaxEffect.SetActive(false);
        }
        this.callback = delegate()
        {
            this.apMaxEffect.SetActive(this.currentAp == 16);
            this.Stop();
            if (callback != null)
            {
                callback();
            }
            this.animationDataList.Clear();
        };
        this.state = BattleUIMultiSharedAP.State.Update;
    }