void Move() { Vector3 tempVector = Vector3.right * Input.GetAxis("Horizontal"); var position = transform.position; position = Vector3.MoveTowards(position, position + tempVector, speed * Time.deltaTime); transform.position = position; if (tempVector.x < 0) { _sprite.flipX = true; _directionPunch = DirectionPunch.left; } else { _sprite.flipX = false; _directionPunch = DirectionPunch.rigth; } }
public Player(Transform position, Rigidbody2D player, DirectionPunch punch) : base(position, player) { Player = player; SetPunch(punch); }
private void SetPunch(DirectionPunch value) { punch = value; }