Exemplo n.º 1
0
    public void SetState(eState state)
    {
        _CounterAttackState = eCounterAttackState.None;
        switch (state)
        {
        case eState.Idle:
            if (!_IgnoreHitAnimations)
            {
                NextAnimation = "Idle";
            }
            _Animator.speed = 1;
            _OnIdle?.Invoke();
            break;

        case eState.Hit:
            if (!_IgnoreHitAnimations)
            {
                NextAnimation = "Hit";
            }
            _OnHit?.Invoke();
            break;

        case eState.Down:
            if (!_IgnoreHitAnimations)
            {
                NextAnimation = "Down";
            }
            if (_State == eState.Dead)
            {
                StartCoroutine(CorpseDisappearRoutine());
                state = eState.Dead;
            }
            else
            {
                StartCoroutine(WakeRoutine());
            }
            break;

        case eState.Wake:
            NextAnimation   = "Wake";
            _Animator.speed = 1;
            break;
        }
        _State = state;
    }
Exemplo n.º 2
0
 public void SetCounterAttackState(eCounterAttackState state)
 {
     _CounterAttackState = state;
 }