| | |
| | | private set |
| | | { |
| | | _isMoving = value; |
| | | animator.SetBool(AnimationStrings.Player.IsMoving, value); |
| | | animator.SetBool(AnimationStrings.Player.isMoving, value); |
| | | } |
| | | } |
| | | |
| | |
| | | private set |
| | | { |
| | | _isFlying = value; |
| | | animator.SetBool(AnimationStrings.Player.IsFlying, value); |
| | | animator_rotor.SetBool(AnimationStrings.Player.IsFlying, value); |
| | | animator.SetBool(AnimationStrings.Player.isFlying, value); |
| | | animator_rotor.SetBool(AnimationStrings.Player.isFlying, value); |
| | | } |
| | | } |
| | | |
| | |
| | | } |
| | | } |
| | | |
| | | public bool CanMove { get |
| | | { |
| | | return animator.GetBool(AnimationStrings.canMove); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | private void Awake() |
| | | { |
| | | rb = GetComponent<Rigidbody2D>(); |
| | | animator = GetComponent<Animator>(); |
| | | animator_rotor = rotorGO.GetComponent<Animator>(); |
| | | touchingDirections = GetComponent<TouchingDirections>(); |
| | | } |
| | | |
| | | // Start is called before the first frame update |
| | | void Start() |
| | | { |
| | | |
| | | } |
| | | |
| | | // Update is called once per frame |
| | | void Update() |
| | | { |
| | | |
| | | } |
| | | |
| | | private void FixedUpdate() |
| | |
| | | |
| | | public void OnMove(InputAction.CallbackContext context) |
| | | { |
| | | if (CanMove) |
| | | { |
| | | moveInput = context.ReadValue<Vector2>(); |
| | | |
| | | IsMoving = moveInput.x != 0; |
| | |
| | | IsFlying = (moveInput.y != 0); |
| | | |
| | | SetFacingDirection(moveInput); |
| | | |
| | | } |
| | | else |
| | | { |
| | | IsMoving = false; |
| | | IsFlying = false; |
| | | moveInput = Vector2.zero; |
| | | } |
| | | } |
| | | |
| | | private void SetFacingDirection(Vector2 moveInput) |