|
void | OnPrimaryMovement (InputValue value) |
|
void | OnSecondaryMovement (InputValue value) |
|
void | OnJump (InputValue value) |
|
void | OnRun (InputValue value) |
|
void | OnDash (InputValue value) |
|
void | OnRoll (InputValue value) |
|
void | OnShoot (InputValue value) |
|
void | OnSecondaryShoot (InputValue value) |
|
void | OnInteract (InputValue value) |
|
void | OnReload (InputValue value) |
|
void | OnPause (InputValue value) |
|
void | OnSwitchWeapon (InputValue value) |
|
void | OnSwitchCharacter (InputValue value) |
|
void | OnTimeControl (InputValue value) |
|
void | OnSwim (InputValue value) |
|
void | OnGlide (InputValue value) |
|
void | OnJetpack (InputValue value) |
|
void | OnFly (InputValue value) |
|
void | OnGrab (InputValue value) |
|
void | OnThrow (InputValue value) |
|
void | OnPush (InputValue value) |
|
virtual void | ControlsModeDetection () |
| Turns mobile controls on or off depending on what's been defined in the inspector, and what target device we're on More...
|
|
virtual void | ProcessButtonStates () |
| Called at LateUpdate(), this method processes the button states of all registered buttons More...
|
|
virtual void | SetMovement () |
| Called every frame, if not on mobile, gets primary movement values from input More...
|
|
virtual void | SetSecondaryMovement () |
| Called every frame, if not on mobile, gets secondary movement values from input More...
|
|
virtual void | SetMovement (Vector2 movement) |
| If you're using a touch joystick, bind your main joystick to this method More...
|
|
virtual void | SetSecondaryMovement (Vector2 movement) |
| If you're using a touch joystick, bind your secondary joystick to this method More...
|
|
virtual void | SetHorizontalMovement (float horizontalInput) |
| If you're using touch arrows, bind your left/right arrows to this method More...
|
|
virtual void | SetVerticalMovement (float verticalInput) |
| If you're using touch arrows, bind your secondary down/up arrows to this method More...
|
|
virtual void | SetSecondaryHorizontalMovement (float horizontalInput) |
| If you're using touch arrows, bind your secondary left/right arrows to this method More...
|
|
virtual void | SetSecondaryVerticalMovement (float verticalInput) |
| If you're using touch arrows, bind your down/up arrows to this method More...
|
|
virtual void | ForceAllButtonStatesTo (MMInput.ButtonStates newState) |
| Lets you force the state of all buttons in the InputManager to the one specified in parameters More...
|
|
virtual void | JumpButtonDown () |
|
virtual void | JumpButtonPressed () |
|
virtual void | JumpButtonUp () |
|
virtual void | SwimButtonDown () |
|
virtual void | SwimButtonPressed () |
|
virtual void | SwimButtonUp () |
|
virtual void | GlideButtonDown () |
|
virtual void | GlideButtonPressed () |
|
virtual void | GlideButtonUp () |
|
virtual void | InteractButtonDown () |
|
virtual void | InteractButtonPressed () |
|
virtual void | InteractButtonUp () |
|
virtual void | DashButtonDown () |
|
virtual void | DashButtonPressed () |
|
virtual void | DashButtonUp () |
|
virtual void | RollButtonDown () |
|
virtual void | RollButtonPressed () |
|
virtual void | RollButtonUp () |
|
virtual void | FlyButtonDown () |
|
virtual void | FlyButtonPressed () |
|
virtual void | FlyButtonUp () |
|
virtual void | RunButtonDown () |
|
virtual void | RunButtonPressed () |
|
virtual void | RunButtonUp () |
|
virtual void | JetpackButtonDown () |
|
virtual void | JetpackButtonPressed () |
|
virtual void | JetpackButtonUp () |
|
virtual void | ReloadButtonDown () |
|
virtual void | ReloadButtonPressed () |
|
virtual void | ReloadButtonUp () |
|
virtual void | PushButtonDown () |
|
virtual void | PushButtonPressed () |
|
virtual void | PushButtonUp () |
|
virtual void | ShootButtonDown () |
|
virtual void | ShootButtonPressed () |
|
virtual void | ShootButtonUp () |
|
virtual void | GripButtonDown () |
|
virtual void | GripButtonPressed () |
|
virtual void | GripButtonUp () |
|
virtual void | SecondaryShootButtonDown () |
|
virtual void | SecondaryShootButtonPressed () |
|
virtual void | SecondaryShootButtonUp () |
|
virtual void | PauseButtonDown () |
|
virtual void | PauseButtonPressed () |
|
virtual void | PauseButtonUp () |
|
virtual void | RestartButtonDown () |
|
virtual void | RestartButtonPressed () |
|
virtual void | RestartButtonUp () |
|
virtual void | SwitchWeaponButtonDown () |
|
virtual void | SwitchWeaponButtonPressed () |
|
virtual void | SwitchWeaponButtonUp () |
|
virtual void | SwitchCharacterButtonDown () |
|
virtual void | SwitchCharacterButtonPressed () |
|
virtual void | SwitchCharacterButtonUp () |
|
virtual void | TimeControlButtonDown () |
|
virtual void | TimeControlButtonPressed () |
|
virtual void | TimeControlButtonUp () |
|
virtual void | GrabButtonDown () |
|
virtual void | GrabButtonPressed () |
|
virtual void | GrabButtonUp () |
|
virtual void | ThrowButtonDown () |
|
virtual void | ThrowButtonPressed () |
|
virtual void | ThrowButtonUp () |
|
|
virtual void | BindButton (InputValue inputValue, MMInput.IMButton imButton) |
|
override void | Update () |
| At update, we check the various commands and update our values and states accordingly. More...
|
|
virtual void | Start () |
| On Start we look for what mode to use, and initialize our axis and buttons More...
|
|
virtual void | Initialization () |
|
virtual void | InitializeButtons () |
| Initializes the buttons. If you want to add more buttons, make sure to register them here. More...
|
|
virtual void | InitializeAxis () |
| Initializes the axis strings. More...
|
|
virtual void | LateUpdate () |
| On LateUpdate, we process our button states More...
|
|
virtual void | GetInputButtons () |
| If we're not on mobile, watches for input changes, and updates our buttons states accordingly More...
|
|
virtual void | SetShootAxis () |
| Called every frame, if not on mobile, gets shoot axis values from input More...
|
|
virtual void | OnApplicationFocus (bool hasFocus) |
| If we lose focus, we reset the states of all buttons More...
|
|
virtual void | Awake () |
| On awake, we initialize our instance. Make sure to call base.Awake() in override if you need awake. More...
|
|
virtual void | InitializeSingleton () |
| Initializes the singleton. More...
|
|
|
enum | InputForcedMode { None
, Mobile
, Desktop
} |
| the possible modes for this input manager More...
|
|
enum | MovementControls { Joystick
, Arrows
} |
| the possible kinds of control used for movement More...
|
|
static T | TryGetInstance () |
|
bool | InputDetectionActive = true |
| set this to false to prevent input to be detected More...
|
|
bool | ResetButtonStatesOnFocusLoss = true |
| if this is true, button states will be reset on focus loss - when clicking outside the player window on PC, for example More...
|
|
string | PlayerID = "Player1" |
| a string identifying the target player(s). You'll need to set this exact same string on your Character, and set its type to Player More...
|
|
bool | AutoMobileDetection = true |
| if this is set to true, the InputManager will try to detect what mode it should be in, based on the current target device More...
|
|
InputForcedMode | ForcedMode |
| use this to force desktop (keyboard, pad) or mobile (touch) mode More...
|
|
bool | HideMobileControlsInEditor = false |
| if this is true, mobile controls will be hidden in editor mode, regardless of the current build target or the forced mode More...
|
|
MovementControls | MovementControl = MovementControls.Joystick |
| use this to specify whether you want to use the default joystick or arrows to move your character More...
|
|
bool | DelayedButtonPresses = false |
| if this is true, button state changes are offset by one frame (usually useful on Android) More...
|
|
bool | SmoothMovement =true |
| If set to true, acceleration / deceleration will take place when moving / stopping. More...
|
|
Vector2 | Threshold = new Vector2(0.1f, 0.4f) |
| the minimum horizontal and vertical value you need to reach to trigger movement on an analog controller (joystick for example) More...
|
|
static void | InitializeStatics () |
| Statics initialization to support enter play modes More...
|
|
List< MMInput.IMButton > | ButtonList |
|
Vector2 | _primaryMovement = Vector2.zero |
|
Vector2 | _secondaryMovement = Vector2.zero |
|
string | _axisHorizontal |
|
string | _axisVertical |
|
string | _axisSecondaryHorizontal |
|
string | _axisSecondaryVertical |
|
string | _axisShoot |
|
string | _axisShootSecondary |
|
static T | _instance |
|
bool | IsMobile [getprotected set] |
| if this is true, we're currently in mobile mode More...
|
|
MMInput.IMButton | JumpButton [getprotected set] |
| the jump button, used for jumps More...
|
|
MMInput.IMButton | SwimButton [getprotected set] |
| the swim button, used to swim More...
|
|
MMInput.IMButton | GlideButton [getprotected set] |
| the glide button, used to glide in the air More...
|
|
MMInput.IMButton | InteractButton [getprotected set] |
| the activate button, used for interactions with zones More...
|
|
MMInput.IMButton | JetpackButton [getprotected set] |
| the jetpack button More...
|
|
MMInput.IMButton | FlyButton [getprotected set] |
| the fly button More...
|
|
MMInput.IMButton | RunButton [getprotected set] |
| the run button More...
|
|
MMInput.IMButton | DashButton [getprotected set] |
| the dash button More...
|
|
MMInput.IMButton | RollButton [getprotected set] |
| the roll button More...
|
|
MMInput.IMButton | GrabButton [getprotected set] |
| the dash button More...
|
|
MMInput.IMButton | ThrowButton [getprotected set] |
| the dash button More...
|
|
MMInput.IMButton | ShootButton [getprotected set] |
| the shoot button More...
|
|
MMInput.IMButton | SecondaryShootButton [getprotected set] |
| the shoot button More...
|
|
MMInput.IMButton | ReloadButton [getprotected set] |
| the reload button More...
|
|
MMInput.IMButton | PushButton [getprotected set] |
| the push button More...
|
|
MMInput.IMButton | GripButton [getprotected set] |
| the grip button More...
|
|
MMInput.IMButton | PauseButton [getprotected set] |
| the pause button More...
|
|
MMInput.IMButton | RestartButton [getprotected set] |
| the restart button More...
|
|
MMInput.IMButton | SwitchCharacterButton [getprotected set] |
| the button used to switch character (either via model or prefab switch) More...
|
|
MMInput.IMButton | SwitchWeaponButton [getprotected set] |
| the switch weapon button More...
|
|
MMInput.IMButton | TimeControlButton [getprotected set] |
| the time control button More...
|
|
MMInput.ButtonStates | ShootAxis [getprotected set] |
| the shoot axis, used as a button (non analogic) More...
|
|
MMInput.ButtonStates | SecondaryShootAxis [getprotected set] |
| the shoot axis, used as a button (non analogic) More...
|
|
virtual Vector2 | PrimaryMovement [get] |
| the primary movement value (used to move the character around) More...
|
|
virtual Vector2 | SecondaryMovement [get] |
| the secondary movement (usually the right stick on a gamepad), used to aim More...
|
|
static bool | HasInstance [get] |
|
static T | Current [get] |
|
static T | Instance [get] |
| Singleton design pattern More...
|
|
This is a replacement InputManager if you prefer using Unity's InputSystem over the legacy one, in a multiplayer context. It requires to be put on an (ideally empty) game object, accompanied by a PlayerInput component, with Actions bound, and Behavior set to SendMessages Note that it's not the default solution in the engine at the moment, because older versions of Unity don't support it, and most people still prefer not using it You can see an example of how to set it up in the MinimalLevel_InputSystem_Multiplayer demo scene