Пример #1
0
    public override void Execute(BattleAnimation battleAnimation)
    {
        bool finished = false;

        GameObject[] list = battleAnimation.GetAnimationObjects(this.animationObject, this.prefabID2);
        if(list != null && list.Length > 0)
        {
            for(int i=0; i<list.Length; i++)
            {
                if(list[i] != null && this.pathToChild != "")
                {
                    Transform t = list[i].transform.Find(this.pathToChild);
                    if(t != null) list[i] = t.gameObject;
                }
                if(list[i] != null && this.DoFade(list[i]))
                {
                    finished = true;
                }
            }
        }

        if(this.wait && finished)
        {
            battleAnimation.StartTime(this.time, this.next);
        }
        else
        {
            battleAnimation.StepFinished(this.next);
        }
    }
Пример #2
0
    public override void Execute(BattleAnimation battleAnimation)
    {
        float t = 0;
        AudioClip[] clip = null;
        if(this.show4)
        {
            if(StatusOrigin.USER.Equals(this.statusOrigin2) && battleAnimation.battleAction.user != null)
            {
                clip = new AudioClip[] {battleAnimation.battleAction.user.GetAudioClip(this.audioID)};
            }
            else if(StatusOrigin.TARGET.Equals(this.statusOrigin2))
            {
                clip = new AudioClip[battleAnimation.battleAction.target.Length];
                for(int i=0; i<battleAnimation.battleAction.target.Length; i++)
                {
                    if(battleAnimation.battleAction.target[i] != null &&
                        battleAnimation.battleAction.target[i].prefabInstance != null)
                    {
                        clip[i] = battleAnimation.battleAction.target[i].GetAudioClip(this.audioID);
                    }
                }
            }
        }
        else clip = new AudioClip[] {battleAnimation.audioClip[this.audioID]};

        bool played = false;
        GameObject[] list = battleAnimation.GetAnimationObjects(this.animationObject, this.prefabID2);
        if(clip != null && clip.Length > 0 &&
            list != null && list.Length > 0)
        {
            for(int i=0; i<list.Length; i++)
            {
                if(list[i] != null && this.pathToChild != "")
                {
                    Transform tr = list[i].transform.Find(this.pathToChild);
                    if(tr != null) list[i] = tr.gameObject;
                }
                if(list[i] != null && i < clip.Length &&
                    this.PlayAudio(list[i], clip[i]))
                {
                    played = true;
                }
            }
        }

        if(played) t = this.MaxClipLength(clip);
        if(wait && t > 0)
        {
            battleAnimation.StartTime(t, this.next);
        }
        else
        {
            battleAnimation.StepFinished(this.next);
        }
    }
Пример #3
0
 public override void Execute(BattleAnimation battleAnimation)
 {
     GameObject[] list = battleAnimation.GetAnimationObjects(this.animationObject, this.prefabID2);
     if(list != null && list.Length > 0)
     {
         for(int i=0; i<list.Length; i++)
         {
             if(list[i] != null)
             {
                 list[i].BroadcastMessage(this.key, this.value, SendMessageOptions.DontRequireReceiver);
             }
         }
     }
     battleAnimation.StepFinished(this.next);
 }
Пример #4
0
 public override void Execute(BattleAnimation battleAnimation)
 {
     GameObject[] list = battleAnimation.GetAnimationObjects(this.animationObject, this.prefabID2);
     if(list != null && list.Length > 0)
     {
         for(int i=0; i<list.Length; i++)
         {
             if(list[i] != null)
             {
                 if(this.pathToChild != "")
                 {
                     Transform t = list[i].transform.Find(this.pathToChild);
                     if(t != null) list[i] = t.gameObject;
                 }
                 list[i].AddComponent(this.key);
             }
         }
     }
     battleAnimation.StepFinished(this.next);
 }
Пример #5
0
 public override void Execute(BattleAnimation battleAnimation)
 {
     GameObject[] list = battleAnimation.GetAnimationObjects(this.animationObject, this.prefabID2);
     if(list != null && list.Length > 0)
     {
         for(int i=0; i<list.Length; i++)
         {
             if(list[i] != null)
             {
                 if(this.pathToChild != "")
                 {
                     Transform t = list[i].transform.Find(this.pathToChild);
                     if(t != null) list[i] = t.gameObject;
                 }
                 list[i].SendMessage(this.key, this.value, SendMessageOptions.DontRequireReceiver);
             }
         }
     }
     battleAnimation.StepFinished(this.next);
 }