private void Update() { if (_health.IsDead) { return; } _horizontal = _input.Horizontal; if (_input.AttackButtonDown) { _animation.AttackAnimation(); return; } if (_input.JumpButtonDown && _onGround.IsGround) { _isJump = true; } _animation.JumpAnimation(!_onGround.IsGround); _animation.MoveAnimations(_horizontal); }
public void Tick() { _currentAttackTime += Time.deltaTime; if (_currentAttackTime > _maxAttackTime) { _flip.FlipCharacter(_isPlayerRightSide.Invoke()? 1f : -1f); _animation.AttackAnimation(); //Attack Voice _attacker.Attack(_playerHealth); _currentAttackTime = 0f; } }