-
-
Notifications
You must be signed in to change notification settings - Fork 2
Documentation
NeKoRoSYS edited this page Aug 26, 2023
·
8 revisions
It's a list of all the scripts that are a part of the NeKoRoSYS's Mobile Input Handling framework. It's not just a list of scripts though, for all these scripts also have sub-lists of information regarding their variables and methods.
-
ControlButton
-
Variables
-
ControlStick joystick: Assigned fromUISettingsthroughPlayerManager. - static class
Instance: A singleton which makes it easy to access during runtime without caching the class reference into the scripts. -
PlayerInputActions playerInputActions: C# class auto-generated by Unity's New Input System. -
InputAction MoveAction: Controls for moving. -
InputAction LookAction: Controls for looking. -
InputAction JumpAction: Controls for jumping. -
InputAction CrouchAction: Controls for crouching. -
InputAction SprintAction: Controls for sprinting.
-
-
Initialization
- void
Awake(): Initializes theInstancesingleton and creates a new instance ofplayerInputActions, then assigns all the listedInputActions.
- void
-
Events
- void
OnEnable(): Enables the instance ofplayerInputActions. - void
OnDisable(): Disables the instance ofplayerInputActions.
- void
-
Example Usage:
Vector2 moveInput = PlayerInput.Instance.MoveAction.ReadValue<Vector2>().normalized; playerManager.GetCharacterController().Move(new Vector3(moveInput.x, 0f, moveInput.y) * Time.deltaTime);
-
PlayerInputis used in:PlayerManager,PlayerMovement, andCameraController
ControlButton
-
Variables
-
ControlStick joystick: Assigned fromUISettingsthroughPlayerManager. - static class
Instance: A singleton which makes it easy to access during runtime without caching the class reference into the scripts. -
PlayerInputActions playerInputActions: C# class auto-generated by Unity's New Input System. -
InputAction MoveAction: Controls for moving. -
InputAction LookAction: Controls for looking. -
InputAction JumpAction: Controls for jumping. -
InputAction CrouchAction: Controls for crouching. -
InputAction SprintAction: Controls for sprinting.
-
-
Initialization
- void
Awake(): Initializes theInstancesingleton and creates a new instance ofplayerInputActions, then assigns all the listedInputActions.
- void
-
Events
- void
OnEnable(): Enables the instance ofplayerInputActions. - void
OnDisable(): Disables the instance ofplayerInputActions.
- void
-
Example Usage:
Vector2 moveInput = PlayerInput.Instance.MoveAction.ReadValue<Vector2>().normalized;
playerManager.GetCharacterController().Move(new Vector3(moveInput.x, 0f, moveInput.y) * Time.deltaTime);-
PlayerInputis used in:PlayerManager,PlayerMovement, andCameraController