Exemplo 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);
    }
Exemplo n.º 2
0
        public DeathEvent(Unit u)
        {
            EventID = "UNIT DEATH";
            StartEvent();
            m_unit = u;

            UnitAnimationController animationController = m_unit.GetComponentInChildren <UnitAnimationController>();

            if (animationController != null)
            {
                animationController.PlayAnimation(UnitAnimationTypes.bDying, null);
            }

            Sequence seq = DOTween.Sequence().InsertCallback(4f, () => EndEvent());

            seq.Play();
        }
Exemplo n.º 3
0
 void Execute(int i)
 {
     base.StartEvent();
     rotator.TurnToPosition(target.transform, () => animator.PlayAnimation(UnitAnimationTypes.bAggro, EndEvent));
     MDebug.Log("Turnevent Queue execute aggro");
 }