private void Move() { if (_characterMovementEnabled == false) { _myCharacterAnimationController.Move(0, false); return; } _xAxisMoveValue = MyInputManager.GetAxis(InputAxis.HorizontalMovement); _myCharacterAnimationController.Move(_xAxisMoveValue, _jump); _jump = false; }
private void Move() { if (Vector2.Distance(transform.localPosition, Vector2.zero) > MaximalDistance) { GameMaster.Events.Rise(EventType.CharacterChanged); return; } var xVelocityValue = MyInputManager.GetAxis(InputAxis.HorizontalMovement) * MaxSpeed; var yVelocityValue = MyInputManager.GetAxis(InputAxis.VerticalMovement) * MaxSpeed; _myRigidBody.velocity = new Vector2(xVelocityValue, yVelocityValue); }