Ejemplo n.º 1
0
    IEnumerator Sequence(UnitAnimationTypes anim, AudioClip exec_audio, Unit caster, Transform target, EventHandler callback_execute)
    {
        UnitAnimationController anim_controller     = m_Unit.GetComponentInChildren <UnitAnimationController>();
        UnitRotationController  rotation_controller = m_Unit.GetComponentInChildren <UnitRotationController>();

        TurnEventQueue.CameraFocusEvent cam_pan = new TurnEventQueue.CameraFocusEvent(caster.transform.position);

        yield return(StartCoroutine(cam_pan.WaitForEvent()));


        if (rotation_controller != null)
        {
            yield return(StartCoroutine(rotation_controller.TurnToTargetPositiom(target, null)));
        }

        if (anim_controller != null)
        {
            anim_controller.PlayAnimation(anim, callback_execute);
        }

        if (exec_audio != null)
        {
            SoundManager.PlaySFX(exec_audio, caster.transform);
        }
        OnExected(caster, target);
    }
Ejemplo n.º 2
0
 public void PlayAnimation(UnitAnimationTypes anim, EventHandler on_exec)
 {
     UnitAnimator.SetExec(on_exec);
     PlayAnimation(anim);
 }
Ejemplo n.º 3
0
 public void PlayAnimation(UnitAnimationTypes anim)
 {
     UnitAnimator.SetExec(null);
     UnitAnimator.SetTrigger(anim.ToString());
 }
Ejemplo n.º 4
0
 public void StartSequence(UnitAnimationTypes anim, AudioClip exec_audio, Unit caster, Transform target, EventHandler callback_execute)
 {
     StartCoroutine(Sequence(anim, exec_audio, caster, target, callback_execute));
 }