예제 #1
0
    virtual public void Update()
    {
        _skillMgr.update();
        _buffMgr.update();

        _playerAnimInfo = _animator.GetCurrentAnimatorStateInfo(0);
        if ((_playerAnimInfo.IsName("Attack1") ||
             _playerAnimInfo.IsName("Attack2")) && _playerAnimInfo.normalizedTime > 1.0f)
        {
            if (_playerAnimInfo.IsName("Attack1"))
            {
                Debug.Log("Attack1");
            }
            else if (_playerAnimInfo.IsName("Attack2"))
            {
                Debug.Log("Attack2");
            }
            else if (_playerAnimInfo.IsName("Attack3"))
            {
                Debug.Log("Attack3");
            }
            _hitCount = 0;   //将hitCount重置为0,即Idle状态
            _animator.SetInteger("Attack1", _hitCount);
        }
        else
        {
            if (_playerAnimInfo.IsName("Attack3"))
            {
                _hitCount = 0;   //将hitCount重置为0,即Idle状态
                _animator.SetInteger("Attack1", _hitCount);
            }
        }
    }