public override void Move(Transform target, float speed) { // Condition for moving the enemy if (IsMove()) { _accelerate.Accelerate(); } else { _accelerate.Decelerate(); } base.Move(target, speed * _accelerate.GetNormalValue()); }
public override void Move(Transform target, float speed) { // Condition for moving the player forward if (Input.GetKey(KeyCode.W)) { _accelerate.Accelerate(); if (!_isMove) { _isMove = true; } } else { _accelerate.Decelerate(); // Stopping the player movement if (_isMove) { _isMove = false; } } base.Move(target, speed * _accelerate.GetNormalValue()); }