TopDown Engine  v4.2
MoreMountains.TopDownEngine.InputManager Class Reference

This persistent singleton handles the inputs and sends commands to the player. IMPORTANT : this script's Execution Order MUST be -100. You can define a script's execution order by clicking on the script's file and then clicking on the Execution Order button at the bottom right of the script's inspector. See https://docs.unity3d.com/Manual/class-ScriptExecution.html for more details More...

Inheritance diagram for MoreMountains.TopDownEngine.InputManager:
MoreMountains.Tools.MMSingleton< InputManager > MoreMountains.TopDownEngine.InputSystemManager MoreMountains.TopDownEngine.InputSystemManagerBase< T > MoreMountains.TopDownEngine.InputSystemManagerEventsBased

Public Types

enum  InputForcedModes { InputForcedModes.None, InputForcedModes.Mobile, InputForcedModes.Desktop }
 the possible modes for this input manager More...
 
enum  MovementControls { MovementControls.Joystick, MovementControls.Arrows }
 the possible kinds of control used for movement More...
 

Public Member Functions

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 SetCameraRotation (Vector2 movement)
 This method lets you bind a mobile joystick to camera rotation 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 SetCamera (Camera targetCamera, bool camera3D)
 Sets an associated camera, used to rotate input based on camera position More...
 
virtual void SetCameraRotationInput (float newValue)
 Sets the current camera rotation input, which you'll want to keep between -1 (left) and 1 (right), 0 being no rotation More...
 
virtual Vector2 ApplyCameraRotation (Vector2 input)
 Rotates input based on camera orientation 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 DashButtonDown ()
 
virtual void DashButtonPressed ()
 
virtual void DashButtonUp ()
 
virtual void CrouchButtonDown ()
 
virtual void CrouchButtonPressed ()
 
virtual void CrouchButtonUp ()
 
virtual void RunButtonDown ()
 
virtual void RunButtonPressed ()
 
virtual void RunButtonUp ()
 
virtual void ReloadButtonDown ()
 
virtual void ReloadButtonPressed ()
 
virtual void ReloadButtonUp ()
 
virtual void InteractButtonDown ()
 
virtual void InteractButtonPressed ()
 
virtual void InteractButtonUp ()
 
virtual void ShootButtonDown ()
 
virtual void ShootButtonPressed ()
 
virtual void ShootButtonUp ()
 
virtual void SecondaryShootButtonDown ()
 
virtual void SecondaryShootButtonPressed ()
 
virtual void SecondaryShootButtonUp ()
 
virtual void PauseButtonDown ()
 
virtual void PauseButtonPressed ()
 
virtual void PauseButtonUp ()
 
virtual void TimeControlButtonDown ()
 
virtual void TimeControlButtonPressed ()
 
virtual void TimeControlButtonUp ()
 
virtual void SwitchWeaponButtonDown ()
 
virtual void SwitchWeaponButtonPressed ()
 
virtual void SwitchWeaponButtonUp ()
 
virtual void SwitchCharacterButtonDown ()
 
virtual void SwitchCharacterButtonPressed ()
 
virtual void SwitchCharacterButtonUp ()
 

Public Attributes

bool InputDetectionActive = true
 set this to false to prevent the InputManager from reading input 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...
 
InputForcedModes InputForcedMode
 use this to force desktop (keyboard, pad) or mobile (touch) mode More...
 
bool ForceWeaponMode = false
 if this is true, the weapon mode will be forced to the selected WeaponForcedMode More...
 
WeaponAim.AimControls WeaponForcedMode
 use this to force a control mode for weapons 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 ForceDesktopIfPrimaryAxisActive = false
 if this is true, the mobile controls will be hidden when the primary desktop axis is active, and the input manager will switch to desktop inputs More...
 
bool AutoRevertToMobileIfPrimaryAxisInactive
 if this is true, the system will revert to mobile controls if the primary axis is inactive for more than AutoRevertToMobileIfPrimaryAxisInactiveDuration More...
 
float AutoRevertToMobileIfPrimaryAxisInactiveDuration = 10f
 the duration, in seconds, after which the system will revert to mobile controls if the primary axis is inactive 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...
 
bool RotateInputBasedOnCameraDirection = false
 if this is true, any directional input coming into this input manager will be rotated to align with the current camera orientation More...
 
virtual Vector2 MousePosition => Input.mousePosition
 the position of the mouse More...
 

Protected Member Functions

override void Awake ()
 On Awake we run our pre-initialization More...
 
virtual void Start ()
 On Start we look for what mode to use, and initialize our axis and buttons More...
 
virtual void PreInitialization ()
 Initializes buttons and axis More...
 
virtual void Initialization ()
 On init we auto detect control schemes More...
 
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 Update ()
 At update, we check the various commands and update our values and states accordingly. More...
 
virtual void TestPrimaryAxis ()
 
virtual void GetLastNonNullValues ()
 Gets the last non null values for both primary and secondary axis 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 SetCameraRotationAxis ()
 Grabs camera rotation input and stores it More...
 
void OnApplicationFocus (bool hasFocus)
 If we lose focus, we reset the states of all buttons More...
 
- Protected Member Functions inherited from MoreMountains.Tools.MMSingleton< InputManager >
virtual void InitializeSingleton ()
 Initializes the singleton. More...
 

Static Protected Member Functions

static void InitializeStatics ()
 Statics initialization to support enter play modes More...
 

Protected Attributes

Camera _targetCamera
 
bool _camera3D
 
float _cameraAngle
 
List< MMInput.IMButtonButtonList
 
Vector2 _primaryMovement = Vector2.zero
 
Vector2 _secondaryMovement = Vector2.zero
 
float _cameraRotationInput = 0f
 
string _axisHorizontal
 
string _axisVertical
 
string _axisSecondaryHorizontal
 
string _axisSecondaryVertical
 
string _axisShoot
 
string _axisShootSecondary
 
string _axisCamera
 
float _primaryAxisActiveTimestamp
 

Properties

virtual bool IsMobile [get, protected set]
 if this is true, we're currently in mobile mode More...
 
virtual bool IsPrimaryAxisActive [get, protected set]
 
virtual MMInput.IMButton JumpButton [get, protected set]
 the jump button, used for jumps and validation More...
 
virtual MMInput.IMButton RunButton [get, protected set]
 the run button More...
 
virtual MMInput.IMButton DashButton [get, protected set]
 the dash button More...
 
virtual MMInput.IMButton CrouchButton [get, protected set]
 the crouch button More...
 
virtual MMInput.IMButton ShootButton [get, protected set]
 the shoot button More...
 
virtual MMInput.IMButton InteractButton [get, protected set]
 the activate button, used for interactions with zones More...
 
virtual MMInput.IMButton SecondaryShootButton [get, protected set]
 the shoot button More...
 
virtual MMInput.IMButton ReloadButton [get, protected set]
 the reload button More...
 
virtual MMInput.IMButton PauseButton [get, protected set]
 the pause button More...
 
virtual MMInput.IMButton TimeControlButton [get, protected set]
 the time control button More...
 
virtual MMInput.IMButton SwitchCharacterButton [get, protected set]
 the button used to switch character (either via model or prefab switch) More...
 
virtual MMInput.IMButton SwitchWeaponButton [get, protected set]
 the switch weapon button More...
 
virtual MMInput.ButtonStates ShootAxis [get, protected set]
 the shoot axis, used as a button (non analogic) More...
 
virtual MMInput.ButtonStates SecondaryShootAxis [get, protected 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...
 
virtual Vector2 LastNonNullPrimaryMovement [get, set]
 the primary movement value (used to move the character around) More...
 
virtual Vector2 LastNonNullSecondaryMovement [get, set]
 the secondary movement (usually the right stick on a gamepad), used to aim More...
 
virtual float CameraRotationInput [get]
 the camera rotation axis input value More...
 
virtual float CameraAngle [get]
 the current camera angle More...
 
- Properties inherited from MoreMountains.Tools.MMSingleton< InputManager >
static T Instance [get]
 Singleton design pattern More...
 

Additional Inherited Members

- Static Public Member Functions inherited from MoreMountains.Tools.MMSingleton< InputManager >
static T TryGetInstance ()
 
- Static Public Attributes inherited from MoreMountains.Tools.MMSingleton< InputManager >
static bool HasInstance
 
static T Current
 
- Static Protected Attributes inherited from MoreMountains.Tools.MMSingleton< InputManager >
static T _instance
 

Detailed Description

This persistent singleton handles the inputs and sends commands to the player. IMPORTANT : this script's Execution Order MUST be -100. You can define a script's execution order by clicking on the script's file and then clicking on the Execution Order button at the bottom right of the script's inspector. See https://docs.unity3d.com/Manual/class-ScriptExecution.html for more details

Member Enumeration Documentation

◆ InputForcedModes

the possible modes for this input manager

Enumerator
None 
Mobile 
Desktop 

◆ MovementControls

the possible kinds of control used for movement

Enumerator
Joystick 
Arrows 

Member Function Documentation

◆ ApplyCameraRotation()

virtual Vector2 MoreMountains.TopDownEngine.InputManager.ApplyCameraRotation ( Vector2  input)
virtual

Rotates input based on camera orientation

Parameters
input
Returns

◆ Awake()

override void MoreMountains.TopDownEngine.InputManager.Awake ( )
protectedvirtual

◆ ControlsModeDetection()

virtual void MoreMountains.TopDownEngine.InputManager.ControlsModeDetection ( )
virtual

Turns mobile controls on or off depending on what's been defined in the inspector, and what target device we're on

◆ CrouchButtonDown()

virtual void MoreMountains.TopDownEngine.InputManager.CrouchButtonDown ( )
virtual

◆ CrouchButtonPressed()

virtual void MoreMountains.TopDownEngine.InputManager.CrouchButtonPressed ( )
virtual

◆ CrouchButtonUp()

virtual void MoreMountains.TopDownEngine.InputManager.CrouchButtonUp ( )
virtual

◆ DashButtonDown()

virtual void MoreMountains.TopDownEngine.InputManager.DashButtonDown ( )
virtual

◆ DashButtonPressed()

virtual void MoreMountains.TopDownEngine.InputManager.DashButtonPressed ( )
virtual

◆ DashButtonUp()

virtual void MoreMountains.TopDownEngine.InputManager.DashButtonUp ( )
virtual

◆ ForceAllButtonStatesTo()

virtual void MoreMountains.TopDownEngine.InputManager.ForceAllButtonStatesTo ( MMInput.ButtonStates  newState)
virtual

Lets you force the state of all buttons in the InputManager to the one specified in parameters

Parameters
newState

◆ GetInputButtons()

virtual void MoreMountains.TopDownEngine.InputManager.GetInputButtons ( )
protectedvirtual

If we're not on mobile, watches for input changes, and updates our buttons states accordingly

Reimplemented in MoreMountains.TopDownEngine.InputSystemManager, MoreMountains.TopDownEngine.InputSystemManagerEventsBased, and MoreMountains.TopDownEngine.InputSystemManagerBase< T >.

◆ GetLastNonNullValues()

virtual void MoreMountains.TopDownEngine.InputManager.GetLastNonNullValues ( )
protectedvirtual

Gets the last non null values for both primary and secondary axis

◆ Initialization()

virtual void MoreMountains.TopDownEngine.InputManager.Initialization ( )
protectedvirtual

On init we auto detect control schemes

Reimplemented in MoreMountains.TopDownEngine.InputSystemManager.

◆ InitializeAxis()

virtual void MoreMountains.TopDownEngine.InputManager.InitializeAxis ( )
protectedvirtual

Initializes the axis strings.

◆ InitializeButtons()

virtual void MoreMountains.TopDownEngine.InputManager.InitializeButtons ( )
protectedvirtual

Initializes the buttons. If you want to add more buttons, make sure to register them here.

◆ InitializeStatics()

static void MoreMountains.TopDownEngine.InputManager.InitializeStatics ( )
staticprotected

Statics initialization to support enter play modes

◆ InteractButtonDown()

virtual void MoreMountains.TopDownEngine.InputManager.InteractButtonDown ( )
virtual

◆ InteractButtonPressed()

virtual void MoreMountains.TopDownEngine.InputManager.InteractButtonPressed ( )
virtual

◆ InteractButtonUp()

virtual void MoreMountains.TopDownEngine.InputManager.InteractButtonUp ( )
virtual

◆ JumpButtonDown()

virtual void MoreMountains.TopDownEngine.InputManager.JumpButtonDown ( )
virtual

◆ JumpButtonPressed()

virtual void MoreMountains.TopDownEngine.InputManager.JumpButtonPressed ( )
virtual

◆ JumpButtonUp()

virtual void MoreMountains.TopDownEngine.InputManager.JumpButtonUp ( )
virtual

◆ LateUpdate()

virtual void MoreMountains.TopDownEngine.InputManager.LateUpdate ( )
protectedvirtual

On LateUpdate, we process our button states

◆ OnApplicationFocus()

void MoreMountains.TopDownEngine.InputManager.OnApplicationFocus ( bool  hasFocus)
protected

If we lose focus, we reset the states of all buttons

Parameters
hasFocus

◆ PauseButtonDown()

virtual void MoreMountains.TopDownEngine.InputManager.PauseButtonDown ( )
virtual

◆ PauseButtonPressed()

virtual void MoreMountains.TopDownEngine.InputManager.PauseButtonPressed ( )
virtual

◆ PauseButtonUp()

virtual void MoreMountains.TopDownEngine.InputManager.PauseButtonUp ( )
virtual

◆ PreInitialization()

virtual void MoreMountains.TopDownEngine.InputManager.PreInitialization ( )
protectedvirtual

Initializes buttons and axis

◆ ProcessButtonStates()

virtual void MoreMountains.TopDownEngine.InputManager.ProcessButtonStates ( )
virtual

Called at LateUpdate(), this method processes the button states of all registered buttons

◆ ReloadButtonDown()

virtual void MoreMountains.TopDownEngine.InputManager.ReloadButtonDown ( )
virtual

◆ ReloadButtonPressed()

virtual void MoreMountains.TopDownEngine.InputManager.ReloadButtonPressed ( )
virtual

◆ ReloadButtonUp()

virtual void MoreMountains.TopDownEngine.InputManager.ReloadButtonUp ( )
virtual

◆ RunButtonDown()

virtual void MoreMountains.TopDownEngine.InputManager.RunButtonDown ( )
virtual

◆ RunButtonPressed()

virtual void MoreMountains.TopDownEngine.InputManager.RunButtonPressed ( )
virtual

◆ RunButtonUp()

virtual void MoreMountains.TopDownEngine.InputManager.RunButtonUp ( )
virtual

◆ SecondaryShootButtonDown()

virtual void MoreMountains.TopDownEngine.InputManager.SecondaryShootButtonDown ( )
virtual

◆ SecondaryShootButtonPressed()

virtual void MoreMountains.TopDownEngine.InputManager.SecondaryShootButtonPressed ( )
virtual

◆ SecondaryShootButtonUp()

virtual void MoreMountains.TopDownEngine.InputManager.SecondaryShootButtonUp ( )
virtual

◆ SetCamera()

virtual void MoreMountains.TopDownEngine.InputManager.SetCamera ( Camera  targetCamera,
bool  camera3D 
)
virtual

Sets an associated camera, used to rotate input based on camera position

Parameters
targetCamera
rotationAxis

◆ SetCameraRotation()

virtual void MoreMountains.TopDownEngine.InputManager.SetCameraRotation ( Vector2  movement)
virtual

This method lets you bind a mobile joystick to camera rotation

Parameters
movement

◆ SetCameraRotationAxis()

virtual void MoreMountains.TopDownEngine.InputManager.SetCameraRotationAxis ( )
protectedvirtual

◆ SetCameraRotationInput()

virtual void MoreMountains.TopDownEngine.InputManager.SetCameraRotationInput ( float  newValue)
virtual

Sets the current camera rotation input, which you'll want to keep between -1 (left) and 1 (right), 0 being no rotation

Parameters
newValue

◆ SetHorizontalMovement()

virtual void MoreMountains.TopDownEngine.InputManager.SetHorizontalMovement ( float  horizontalInput)
virtual

If you're using touch arrows, bind your left/right arrows to this method

.

◆ SetMovement() [1/2]

virtual void MoreMountains.TopDownEngine.InputManager.SetMovement ( )
virtual

Called every frame, if not on mobile, gets primary movement values from input

Reimplemented in MoreMountains.TopDownEngine.InputSystemManager, MoreMountains.TopDownEngine.InputSystemManagerEventsBased, and MoreMountains.TopDownEngine.InputSystemManagerBase< T >.

◆ SetMovement() [2/2]

virtual void MoreMountains.TopDownEngine.InputManager.SetMovement ( Vector2  movement)
virtual

If you're using a touch joystick, bind your main joystick to this method

Parameters
movementMovement.

◆ SetSecondaryHorizontalMovement()

virtual void MoreMountains.TopDownEngine.InputManager.SetSecondaryHorizontalMovement ( float  horizontalInput)
virtual

If you're using touch arrows, bind your secondary left/right arrows to this method

.

◆ SetSecondaryMovement() [1/2]

virtual void MoreMountains.TopDownEngine.InputManager.SetSecondaryMovement ( )
virtual

Called every frame, if not on mobile, gets secondary movement values from input

Reimplemented in MoreMountains.TopDownEngine.InputSystemManager, MoreMountains.TopDownEngine.InputSystemManagerEventsBased, and MoreMountains.TopDownEngine.InputSystemManagerBase< T >.

◆ SetSecondaryMovement() [2/2]

virtual void MoreMountains.TopDownEngine.InputManager.SetSecondaryMovement ( Vector2  movement)
virtual

If you're using a touch joystick, bind your secondary joystick to this method

Parameters
movementMovement.

◆ SetSecondaryVerticalMovement()

virtual void MoreMountains.TopDownEngine.InputManager.SetSecondaryVerticalMovement ( float  verticalInput)
virtual

If you're using touch arrows, bind your down/up arrows to this method

.

◆ SetShootAxis()

virtual void MoreMountains.TopDownEngine.InputManager.SetShootAxis ( )
protectedvirtual

◆ SetVerticalMovement()

virtual void MoreMountains.TopDownEngine.InputManager.SetVerticalMovement ( float  verticalInput)
virtual

If you're using touch arrows, bind your secondary down/up arrows to this method

.

◆ ShootButtonDown()

virtual void MoreMountains.TopDownEngine.InputManager.ShootButtonDown ( )
virtual

◆ ShootButtonPressed()

virtual void MoreMountains.TopDownEngine.InputManager.ShootButtonPressed ( )
virtual

◆ ShootButtonUp()

virtual void MoreMountains.TopDownEngine.InputManager.ShootButtonUp ( )
virtual

◆ Start()

virtual void MoreMountains.TopDownEngine.InputManager.Start ( )
protectedvirtual

On Start we look for what mode to use, and initialize our axis and buttons

◆ SwitchCharacterButtonDown()

virtual void MoreMountains.TopDownEngine.InputManager.SwitchCharacterButtonDown ( )
virtual

◆ SwitchCharacterButtonPressed()

virtual void MoreMountains.TopDownEngine.InputManager.SwitchCharacterButtonPressed ( )
virtual

◆ SwitchCharacterButtonUp()

virtual void MoreMountains.TopDownEngine.InputManager.SwitchCharacterButtonUp ( )
virtual

◆ SwitchWeaponButtonDown()

virtual void MoreMountains.TopDownEngine.InputManager.SwitchWeaponButtonDown ( )
virtual

◆ SwitchWeaponButtonPressed()

virtual void MoreMountains.TopDownEngine.InputManager.SwitchWeaponButtonPressed ( )
virtual

◆ SwitchWeaponButtonUp()

virtual void MoreMountains.TopDownEngine.InputManager.SwitchWeaponButtonUp ( )
virtual

◆ TestPrimaryAxis()

virtual void MoreMountains.TopDownEngine.InputManager.TestPrimaryAxis ( )
protectedvirtual

◆ TimeControlButtonDown()

virtual void MoreMountains.TopDownEngine.InputManager.TimeControlButtonDown ( )
virtual

◆ TimeControlButtonPressed()

virtual void MoreMountains.TopDownEngine.InputManager.TimeControlButtonPressed ( )
virtual

◆ TimeControlButtonUp()

virtual void MoreMountains.TopDownEngine.InputManager.TimeControlButtonUp ( )
virtual

◆ Update()

virtual void MoreMountains.TopDownEngine.InputManager.Update ( )
protectedvirtual

At update, we check the various commands and update our values and states accordingly.

Reimplemented in MoreMountains.TopDownEngine.InputSystemManagerBase< T >, and MoreMountains.TopDownEngine.InputSystemManager.

Member Data Documentation

◆ _axisCamera

string MoreMountains.TopDownEngine.InputManager._axisCamera
protected

◆ _axisHorizontal

string MoreMountains.TopDownEngine.InputManager._axisHorizontal
protected

◆ _axisSecondaryHorizontal

string MoreMountains.TopDownEngine.InputManager._axisSecondaryHorizontal
protected

◆ _axisSecondaryVertical

string MoreMountains.TopDownEngine.InputManager._axisSecondaryVertical
protected

◆ _axisShoot

string MoreMountains.TopDownEngine.InputManager._axisShoot
protected

◆ _axisShootSecondary

string MoreMountains.TopDownEngine.InputManager._axisShootSecondary
protected

◆ _axisVertical

string MoreMountains.TopDownEngine.InputManager._axisVertical
protected

◆ _camera3D

bool MoreMountains.TopDownEngine.InputManager._camera3D
protected

◆ _cameraAngle

float MoreMountains.TopDownEngine.InputManager._cameraAngle
protected

◆ _cameraRotationInput

float MoreMountains.TopDownEngine.InputManager._cameraRotationInput = 0f
protected

◆ _primaryAxisActiveTimestamp

float MoreMountains.TopDownEngine.InputManager._primaryAxisActiveTimestamp
protected

◆ _primaryMovement

Vector2 MoreMountains.TopDownEngine.InputManager._primaryMovement = Vector2.zero
protected

◆ _secondaryMovement

Vector2 MoreMountains.TopDownEngine.InputManager._secondaryMovement = Vector2.zero
protected

◆ _targetCamera

Camera MoreMountains.TopDownEngine.InputManager._targetCamera
protected

◆ AutoMobileDetection

bool MoreMountains.TopDownEngine.InputManager.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

◆ AutoRevertToMobileIfPrimaryAxisInactive

bool MoreMountains.TopDownEngine.InputManager.AutoRevertToMobileIfPrimaryAxisInactive

if this is true, the system will revert to mobile controls if the primary axis is inactive for more than AutoRevertToMobileIfPrimaryAxisInactiveDuration

◆ AutoRevertToMobileIfPrimaryAxisInactiveDuration

float MoreMountains.TopDownEngine.InputManager.AutoRevertToMobileIfPrimaryAxisInactiveDuration = 10f

the duration, in seconds, after which the system will revert to mobile controls if the primary axis is inactive

◆ ButtonList

List<MMInput.IMButton> MoreMountains.TopDownEngine.InputManager.ButtonList
protected

◆ ForceDesktopIfPrimaryAxisActive

bool MoreMountains.TopDownEngine.InputManager.ForceDesktopIfPrimaryAxisActive = false

if this is true, the mobile controls will be hidden when the primary desktop axis is active, and the input manager will switch to desktop inputs

◆ ForceWeaponMode

bool MoreMountains.TopDownEngine.InputManager.ForceWeaponMode = false

if this is true, the weapon mode will be forced to the selected WeaponForcedMode

◆ HideMobileControlsInEditor

bool MoreMountains.TopDownEngine.InputManager.HideMobileControlsInEditor = false

if this is true, mobile controls will be hidden in editor mode, regardless of the current build target or the forced mode

◆ InputDetectionActive

bool MoreMountains.TopDownEngine.InputManager.InputDetectionActive = true

set this to false to prevent the InputManager from reading input

◆ InputForcedMode

InputForcedModes MoreMountains.TopDownEngine.InputManager.InputForcedMode

use this to force desktop (keyboard, pad) or mobile (touch) mode

◆ MousePosition

virtual Vector2 MoreMountains.TopDownEngine.InputManager.MousePosition => Input.mousePosition

the position of the mouse

◆ MovementControl

MovementControls MoreMountains.TopDownEngine.InputManager.MovementControl = MovementControls.Joystick

use this to specify whether you want to use the default joystick or arrows to move your character

◆ PlayerID

string MoreMountains.TopDownEngine.InputManager.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

◆ ResetButtonStatesOnFocusLoss

bool MoreMountains.TopDownEngine.InputManager.ResetButtonStatesOnFocusLoss = true

if this is true, button states will be reset on focus loss - when clicking outside the player window on PC, for example

◆ RotateInputBasedOnCameraDirection

bool MoreMountains.TopDownEngine.InputManager.RotateInputBasedOnCameraDirection = false

if this is true, any directional input coming into this input manager will be rotated to align with the current camera orientation

◆ SmoothMovement

bool MoreMountains.TopDownEngine.InputManager.SmoothMovement =true

If set to true, acceleration / deceleration will take place when moving / stopping.

◆ Threshold

Vector2 MoreMountains.TopDownEngine.InputManager.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)

◆ WeaponForcedMode

WeaponAim.AimControls MoreMountains.TopDownEngine.InputManager.WeaponForcedMode

use this to force a control mode for weapons

Property Documentation

◆ CameraAngle

virtual float MoreMountains.TopDownEngine.InputManager.CameraAngle
get

the current camera angle

◆ CameraRotationInput

virtual float MoreMountains.TopDownEngine.InputManager.CameraRotationInput
get

the camera rotation axis input value

◆ CrouchButton

virtual MMInput.IMButton MoreMountains.TopDownEngine.InputManager.CrouchButton
getprotected set

the crouch button

◆ DashButton

virtual MMInput.IMButton MoreMountains.TopDownEngine.InputManager.DashButton
getprotected set

the dash button

◆ InteractButton

virtual MMInput.IMButton MoreMountains.TopDownEngine.InputManager.InteractButton
getprotected set

the activate button, used for interactions with zones

◆ IsMobile

virtual bool MoreMountains.TopDownEngine.InputManager.IsMobile
getprotected set

if this is true, we're currently in mobile mode

◆ IsPrimaryAxisActive

virtual bool MoreMountains.TopDownEngine.InputManager.IsPrimaryAxisActive
getprotected set

◆ JumpButton

virtual MMInput.IMButton MoreMountains.TopDownEngine.InputManager.JumpButton
getprotected set

the jump button, used for jumps and validation

◆ LastNonNullPrimaryMovement

virtual Vector2 MoreMountains.TopDownEngine.InputManager.LastNonNullPrimaryMovement
getset

the primary movement value (used to move the character around)

◆ LastNonNullSecondaryMovement

virtual Vector2 MoreMountains.TopDownEngine.InputManager.LastNonNullSecondaryMovement
getset

the secondary movement (usually the right stick on a gamepad), used to aim

◆ PauseButton

virtual MMInput.IMButton MoreMountains.TopDownEngine.InputManager.PauseButton
getprotected set

the pause button

◆ PrimaryMovement

virtual Vector2 MoreMountains.TopDownEngine.InputManager.PrimaryMovement
get

the primary movement value (used to move the character around)

◆ ReloadButton

virtual MMInput.IMButton MoreMountains.TopDownEngine.InputManager.ReloadButton
getprotected set

the reload button

◆ RunButton

virtual MMInput.IMButton MoreMountains.TopDownEngine.InputManager.RunButton
getprotected set

the run button

◆ SecondaryMovement

virtual Vector2 MoreMountains.TopDownEngine.InputManager.SecondaryMovement
get

the secondary movement (usually the right stick on a gamepad), used to aim

◆ SecondaryShootAxis

virtual MMInput.ButtonStates MoreMountains.TopDownEngine.InputManager.SecondaryShootAxis
getprotected set

the shoot axis, used as a button (non analogic)

◆ SecondaryShootButton

virtual MMInput.IMButton MoreMountains.TopDownEngine.InputManager.SecondaryShootButton
getprotected set

the shoot button

◆ ShootAxis

virtual MMInput.ButtonStates MoreMountains.TopDownEngine.InputManager.ShootAxis
getprotected set

the shoot axis, used as a button (non analogic)

◆ ShootButton

virtual MMInput.IMButton MoreMountains.TopDownEngine.InputManager.ShootButton
getprotected set

the shoot button

◆ SwitchCharacterButton

virtual MMInput.IMButton MoreMountains.TopDownEngine.InputManager.SwitchCharacterButton
getprotected set

the button used to switch character (either via model or prefab switch)

◆ SwitchWeaponButton

virtual MMInput.IMButton MoreMountains.TopDownEngine.InputManager.SwitchWeaponButton
getprotected set

the switch weapon button

◆ TimeControlButton

virtual MMInput.IMButton MoreMountains.TopDownEngine.InputManager.TimeControlButton
getprotected set

the time control button


The documentation for this class was generated from the following file: