using System; using System.Collections; using System.Collections.Generic; using UnityEngine; public enum JoyStickMode { Motion, LookAt, } public class FixedJoystick : Joystick { public static Vector2 motionDirection = Vector2.zero; public static int lookDirection = 0; [SerializeField] private JoyStickMode joyStickMode = 0; private void Update() { if (joyStickMode == JoyStickMode.Motion) { motionDirection = Direction; } else { lookDirection = Direction.x == 0 ? 0 : Direction.x > 0 ? 1 : -1; } } }