Platformer Pro  2.3.2
A platform game kit for Unity.
PlatformerPro.StandardInput Class Reference

The standard input with reassignable buttons and a set of default key assignments (arrows + z, x, and c). Also handles controllers and user configurable inputs. More...

Inheritance diagram for PlatformerPro.StandardInput:
PlatformerPro.Input PlatformerPro.PlatformerProMonoBehaviour PlatformerPro.TriggerAsButtonInput

Public Member Functions

override bool LoadInputData (string dataName)
 Loads the input data from the given player prefs. More...
 
override void LoadInputData (StandardInputData data)
 Loads the provided input data. More...
 
virtual bool SaveInputData (string dataName)
 Saves the input data. More...
 
virtual StandardInputData GetInputData ()
 Sets this input to reflect the provided data object. More...
 
void SetActionButton (int index, ButtonState state)
 
override ButtonState GetActionButtonState (int buttonIndex)
 Get the state of an action button. More...
 
override void ForceButtonState (int index, ButtonState state)
 Allow some external component to set button state (for current frame only). More...
 
override bool SetKey (KeyType type, KeyCode keyCode)
 Sets the keyboayrd key that corresponds to a Platform PRO input key. More...
 
override bool SetKey (KeyType type, KeyCode keyCode, int keyNumber)
 Sets the keyboayrd key that corresponds to a Platform PRO input key. More...
 
override KeyCode GetKeyForType (KeyType type, int keyNumber)
 Gets the key code for the given type. More...
 
override string GetAxisForType (KeyType type)
 Gets the name of the axis for the given key type. More...
 
override bool SetAxis (KeyType type, string axis, bool reverseAxis)
 Sets the joystick axis that corresponds to a Platform PRO input axis. More...
 
override void ConsumeJumpButton ()
 Consumes a jump button down event converting it in to a button held event. This implementation simply zeros out the buffer timer. More...
 
override void ConsumeRunButton ()
 Consumes a run button down event converting it in to a button held event. This implementation simply zeros out the buffer timer. More...
 
override void ConsumeActionButton (int index)
 Consumes an action button down event converting it in to a button held event. This implementation simply zeros out the buffer timer. More...
 
override bool SaveInputData ()
 Saves the input data usinf the default data name. More...
 
- Public Member Functions inherited from PlatformerPro.PlatformerProMonoBehaviour
virtual void Validate (PlatformerProMonoBehaviour myTarget)
 Override this method if you want to provide custom validation. The actual code should be surrounded by the if UNITY_EDITOR / endif directive. More...
 

Public Attributes

string dataToLoad = "Player1"
 Name of the input data file to load by default. More...
 
bool enableController = true
 Should the controller input be enabled. More...
 
bool enableKeyboard = true
 Should the keyboard input be enabled. More...
 
string horizontalAxisName = "Joystick1Axis1"
 The horizontal controller axis. More...
 
bool reverseHorizontalAxis
 Should we reverse the values of the horizontal axis. More...
 
float digitalHorizontalThreshold = 0.25f
 Threshold for digital input to be considered non-zero. More...
 
string verticalAxisName = "Joystick1Axis2"
 The vertical controller axis. More...
 
bool reverseVerticalAxis
 Should we reverse the values of the vertival axis. More...
 
float digitalVerticalThreshold = 0.25f
 Threshold for digital input to be considered non-zero. More...
 
string altHorizontalAxisName = "Joystick1Axis7"
 The horizontal controller axis. More...
 
bool reverseAltHorizontalAxis
 Should we reverse the values of the horizontal axis. More...
 
float digitalAltHorizontalThreshold = 0.25f
 Threshold for digital input to be considered non-zero. More...
 
string altVerticalAxisName = "Joystick1Axis8"
 The alternateVertical controller axis. More...
 
bool reverseAltVerticalAxis
 Should we reverse the values of the alternate vertival axis. More...
 
float digitalAltVerticalThreshold = 0.25f
 Threshold for digital input to be considered non-zero. More...
 
KeyCode right = KeyCode.RightArrow
 The right key. More...
 
KeyCode left = KeyCode.LeftArrow
 The left key. More...
 
KeyCode up = KeyCode.UpArrow
 The up key. More...
 
KeyCode down = KeyCode.DownArrow
 The down key. More...
 
KeyCode jump = KeyCode.Z
 The jump key. More...
 
KeyCode run = KeyCode.X
 The run key. More...
 
KeyCode pause = KeyCode.P
 The pause key. More...
 
KeyCode[] actionButtons
 The action buttons with the first value in the array being the default. More...
 
- Public Attributes inherited from PlatformerPro.Input
int playerId
 The player who is assigned to this input. More...
 

Static Public Attributes

const string SavedPreferencePrefix = "PP.Input."
 Constant used as a prefix for saving and loading input configuration from player prefs. More...
 

Protected Member Functions

virtual void PreInit ()
 Init this instance. More...
 
virtual void SetInputData (StandardInputData data)
 Sets this input to reflect the provided data object. More...
 
virtual void ClearKeyCode (KeyCode keyCode)
 Sets any KeyType that has a matching KeyCode to KeyCode.NONE More...
 
virtual ButtonState GetStateForKey (KeyCode key)
 Gets the button state for given keyboard key. More...
 

Protected Attributes

int lastDigitalVerticalAxisState
 Stores the last state of the vertical axis (digital). More...
 
int lastDigitalHorizontalAxisState
 Stores the last state of the horizontal axis (digital). More...
 
int lastDigitalAltVerticalAxisState
 Stores the last state of the alternate vertical axis (digital). More...
 
int lastDigitalAltHorizontalAxisState
 Stores the last state of the alternate horizontal axis (digital). More...
 
ButtonState[] forceButtonState
 Allow users to force a state for a given frame. More...
 
bool consumeJumpButton
 If true the jump button wont report DOWN only HELD. More...
 
bool consumeRunButton
 If true the run button wont report DOWN only HELD. More...
 
bool[] consumeActionButton
 If true the given action button wont report DOWN only HELD. More...
 

Properties

override string Header [get]
 Gets the header string used to describe the component. More...
 
override float? HorizontalAxis [get]
 A float value clamped between -1 for completely left and 1 for compeletely right. 0.5f would mean "half right". This implementation only returns -1.0f, 0.0f or 1.0f. More...
 
override int?? HorizontalAxisDigital [get]
 A "digital" version of the horizontal axis in which the only valid values are -1 for LEFT, 0 for NONE, and 1 for RIGHT. More...
 
override ButtonState HorizontalAxisState [get]
 Return ButtonState.DOWN if the axis state went from <= 0 to 1 or >= 0 to -1. Return ButtonState.HELD if the axis stayed at the same value and wasn't 0; Return ButtonState.UP if the axis state went from != 0 to 0. More...
 
override float? VerticalAxis [get]
 A float value clamped between -1 for completely DOWN and 1 for completely UP. 0.5f would mean "half up". The exact interpretation of the values is up to the movement behaviours. More...
 
override int?? VerticalAxisDigital [get]
 A "digital" version of the vertical axis in which the only valid values are -1 for DOWN, 0 for NONE, and 1 for UP. More...
 
override ButtonState VerticalAxisState [get]
 Return ButtonState.DOWN if the axis state went from <= 0 to 1 or >= 0 to -1. Return ButtonState.HELD if the axis stayed at the same value and wasn't 0; Return ButtonState.UP if the axis state went from != 0 to 0. More...
 
override float? AltHorizontalAxis [get]
 A float value clamped between -1 for completely left and 1 for compeletely right. 0.5f would mean "half right". This implementation only returns -1.0f, 0.0f or 1.0f. More...
 
override int?? AltHorizontalAxisDigital [get]
 A "digital" version of the horizontal axis in which the only valid values are -1 for LEFT, 0 for NONE, and 1 for RIGHT. More...
 
override ButtonState AltHorizontalAxisState [get]
 Return ButtonState.DOWN if the axis state went from <= 0 to 1 or >= 0 to -1. Return ButtonState.HELD if the axis stayed at the same value and wasn't 0; Return ButtonState.UP if the axis state went from != 0 to 0. More...
 
override float? AltVerticalAxis [get]
 A float value clamped between -1 for completely DOWN and 1 for completely UP. 0.5f would mean "half up". The exact interpretation of the values is up to the movement behaviours. More...
 
override int?? AltVerticalAxisDigital [get]
 A "digital" version of the alternate vertical axis in which the only valid values are -1 for DOWN, 0 for NONE, and 1 for UP. More...
 
override ButtonState AltVerticalAxisState [get]
 Return ButtonState.DOWN if the axis state went from <= 0 to 1 or >= 0 to -1. Return ButtonState.HELD if the axis stayed at the same value and wasn't 0; Return ButtonState.UP if the axis state went from != 0 to 0. More...
 
override ButtonState JumpButton [get]
 State of the jump button. More...
 
override ButtonState RunButton [get]
 State of the run button. More...
 
override ButtonState PauseButton [get]
 State of the pause button. More...
 
override ButtonState ActionButton [get]
 State of the default action button. This could be pickup, attack, etc. If you need more buttons use the additional action use Input.GetActionButtonState() More...
 
override bool AnyKey [get]
 Returns true if any button or action key is being held. More...
 
- Properties inherited from PlatformerPro.Input
abstract float HorizontalAxis [get]
 A float value clamped between -1 for completely left and 1 for compeletely right. 0.5f would mean "half right". The exact interpretation of the values is up to the movement behaviours. More...
 
abstract int HorizontalAxisDigital [get]
 A "digital" version of the horizontal axis in which the only valid values are -1 for LEFT, 0 for NONE, and 1 for RIGHT. More...
 
abstract ButtonState HorizontalAxisState [get]
 Return ButtonState.DOWN if the axis state went from <= 0 to 1 or >= 0 to -1. Return ButtonState.HELD if the axis stayed at the same value. Return ButtonState.UP if the axis state went from != 0 to 0. More...
 
abstract float VerticalAxis [get]
 A float value clamped between -1 for completely DOWN and 1 for completely UP. 0.5f would mean "half up". The exact interpretation of the values is up to the movement behaviours. More...
 
abstract int VerticalAxisDigital [get]
 A "digital" version of the alternate vertical axis in which the only valid values are -1 for DOWN, 0 for NONE, and 1 for UP. More...
 
abstract ButtonState VerticalAxisState [get]
 Return ButtonState.DOWN if the axis state went from <= 0 to 1 or >= 0 to -1. Return ButtonState.HELD if the axis stayed at the same value. Return ButtonState.UP if the axis state went from != 0 to 0. More...
 
abstract float AltHorizontalAxis [get]
 A float value clamped between -1 for completely left and 1 for compeletely right. 0.5f would mean "half right". The exact interpretation of the values is up to the movement behaviours. More...
 
abstract int AltHorizontalAxisDigital [get]
 A "digital" version of the alternate horizontal axis in which the only valid values are -1 for LEFT, 0 for NONE, and 1 for RIGHT. More...
 
abstract ButtonState AltHorizontalAxisState [get]
 Return ButtonState.DOWN if the axis state went from <= 0 to 1 or >= 0 to -1. Return ButtonState.HELD if the axis stayed at the same value. Return ButtonState.UP if the axis state went from != 0 to 0. More...
 
abstract float AltVerticalAxis [get]
 A float value clamped between -1 for completely DOWN and 1 for completely UP. 0.5f would mean "half up". The exact interpretation of the values is up to the movement behaviours. More...
 
abstract int AltVerticalAxisDigital [get]
 A "digital" version of the vertical axis in which the only valid values are -1 for DOWN, 0 for NONE, and 1 for UP. More...
 
abstract ButtonState AltVerticalAxisState [get]
 Return ButtonState.DOWN if the axis state went from <= 0 to 1 or >= 0 to -1. Return ButtonState.HELD if the axis stayed at the same value. Return ButtonState.UP if the axis state went from != 0 to 0. More...
 
abstract ButtonState JumpButton [get]
 State of the jump button. More...
 
abstract ButtonState RunButton [get]
 State of the run button. More...
 
abstract ButtonState PauseButton [get]
 State of the pause button. More...
 
abstract ButtonState ActionButton [get]
 State of the default action button. This could be pickup, attack, etc. If you need more buttons use the additional action use Input.GetActionButtonState() More...
 
abstract bool AnyKey [get]
 Returns true if any button or action key is being pressed. More...
 
- Properties inherited from PlatformerPro.PlatformerProMonoBehaviour
virtual string Header [get]
 Gets the header string used to describe the component. More...
 
virtual string DocLink [get]
 Gets a link to documentation site. More...
 
virtual string VideoLink [get]
 Gets a link to a youtube video. More...
 
virtual string Deprecated [get]
 If non-null this component is deprecated. The string shows a message indicating how it should be replaced. More...
 

Detailed Description

The standard input with reassignable buttons and a set of default key assignments (arrows + z, x, and c). Also handles controllers and user configurable inputs.

Member Function Documentation

◆ ClearKeyCode()

virtual void PlatformerPro.StandardInput.ClearKeyCode ( KeyCode  keyCode)
protectedvirtual

Sets any KeyType that has a matching KeyCode to KeyCode.NONE

Parameters
keyCodeThe key code to match.

◆ ConsumeActionButton()

override void PlatformerPro.StandardInput.ConsumeActionButton ( int  index)
virtual

Consumes an action button down event converting it in to a button held event. This implementation simply zeros out the buffer timer.

Reimplemented from PlatformerPro.Input.

◆ ConsumeJumpButton()

override void PlatformerPro.StandardInput.ConsumeJumpButton ( )
virtual

Consumes a jump button down event converting it in to a button held event. This implementation simply zeros out the buffer timer.

Reimplemented from PlatformerPro.Input.

◆ ConsumeRunButton()

override void PlatformerPro.StandardInput.ConsumeRunButton ( )
virtual

Consumes a run button down event converting it in to a button held event. This implementation simply zeros out the buffer timer.

Reimplemented from PlatformerPro.Input.

◆ ForceButtonState()

override void PlatformerPro.StandardInput.ForceButtonState ( int  index,
ButtonState  state 
)
virtual

Allow some external component to set button state (for current frame only).

Parameters
indexIndex.
stateState.

Implements PlatformerPro.Input.

◆ GetActionButtonState()

override ButtonState PlatformerPro.StandardInput.GetActionButtonState ( int  buttonIndex)
virtual

Get the state of an action button.

Returns
The buttons state.
Parameters
buttonIndexThe index of the button.

Implements PlatformerPro.Input.

Reimplemented in PlatformerPro.TriggerAsButtonInput.

◆ GetAxisForType()

override string PlatformerPro.StandardInput.GetAxisForType ( KeyType  type)
virtual

Gets the name of the axis for the given key type.

Returns
The axis name.
Parameters
typeType.

Implements PlatformerPro.Input.

◆ GetInputData()

virtual StandardInputData PlatformerPro.StandardInput.GetInputData ( )
virtual

Sets this input to reflect the provided data object.

Parameters
dataData.

◆ GetKeyForType()

override KeyCode PlatformerPro.StandardInput.GetKeyForType ( KeyType  type,
int  keyNumber 
)
virtual

Gets the key code for the given type.

Returns
The mathcing KeyCode or keyCode.None if there is no match.
Parameters
typeKey type.
keyNumberKey number if this is an action key (ignored otherwise).

Implements PlatformerPro.Input.

◆ GetStateForKey()

virtual ButtonState PlatformerPro.StandardInput.GetStateForKey ( KeyCode  key)
protectedvirtual

Gets the button state for given keyboard key.

Returns
The state for key.
Parameters
keyKey to check.

◆ LoadInputData() [1/2]

override void PlatformerPro.StandardInput.LoadInputData ( StandardInputData  data)
virtual

Loads the provided input data.

Parameters
dataData to load.

Implements PlatformerPro.Input.

◆ LoadInputData() [2/2]

override bool PlatformerPro.StandardInput.LoadInputData ( string  dataName)
virtual

Loads the input data from the given player prefs.

Returns
true, if input data was loaded, false otherwise.
Parameters
dataNamePlayer prefs name (constant prefix will be added too).

Implements PlatformerPro.Input.

◆ PreInit()

virtual void PlatformerPro.StandardInput.PreInit ( )
protectedvirtual

Init this instance.

◆ SaveInputData() [1/2]

override bool PlatformerPro.StandardInput.SaveInputData ( )
virtual

Saves the input data usinf the default data name.

Returns
true, if input data was saved, false otherwise.

Implements PlatformerPro.Input.

◆ SaveInputData() [2/2]

virtual bool PlatformerPro.StandardInput.SaveInputData ( string  dataName)
virtual

Saves the input data.

Returns
true, if input data was saved, false otherwise.
Parameters
dataNameData name.

◆ SetActionButton()

void PlatformerPro.StandardInput.SetActionButton ( int  index,
ButtonState  state 
)

◆ SetAxis()

override bool PlatformerPro.StandardInput.SetAxis ( KeyType  type,
string  axis,
bool  reverseAxis 
)
virtual

Sets the joystick axis that corresponds to a Platform PRO input axis.

Returns
true, if key was set, false otherwise.
Parameters
typeType of key being set.
axisUnity axis name.
reverseAxisShould we flip the axis?

Implements PlatformerPro.Input.

◆ SetInputData()

virtual void PlatformerPro.StandardInput.SetInputData ( StandardInputData  data)
protectedvirtual

Sets this input to reflect the provided data object.

Parameters
dataData.

◆ SetKey() [1/2]

override bool PlatformerPro.StandardInput.SetKey ( KeyType  type,
KeyCode  keyCode 
)
virtual

Sets the keyboayrd key that corresponds to a Platform PRO input key.

Returns
true, if key was set, false otherwise.
Parameters
typeType of key being set.
keyCodeUnity key code.

Implements PlatformerPro.Input.

◆ SetKey() [2/2]

override bool PlatformerPro.StandardInput.SetKey ( KeyType  type,
KeyCode  keyCode,
int  keyNumber 
)
virtual

Sets the keyboayrd key that corresponds to a Platform PRO input key.

Returns
true, if key was set, false otherwise.
Parameters
typeType of key being set.
keyNumberThe action key number, ignored if not setting an action key.

Implements PlatformerPro.Input.

Member Data Documentation

◆ actionButtons

KeyCode [] PlatformerPro.StandardInput.actionButtons

The action buttons with the first value in the array being the default.

◆ altHorizontalAxisName

string PlatformerPro.StandardInput.altHorizontalAxisName = "Joystick1Axis7"

The horizontal controller axis.

◆ altVerticalAxisName

string PlatformerPro.StandardInput.altVerticalAxisName = "Joystick1Axis8"

The alternateVertical controller axis.

◆ consumeActionButton

bool [] PlatformerPro.StandardInput.consumeActionButton
protected

If true the given action button wont report DOWN only HELD.

◆ consumeJumpButton

bool PlatformerPro.StandardInput.consumeJumpButton
protected

If true the jump button wont report DOWN only HELD.

◆ consumeRunButton

bool PlatformerPro.StandardInput.consumeRunButton
protected

If true the run button wont report DOWN only HELD.

◆ dataToLoad

string PlatformerPro.StandardInput.dataToLoad = "Player1"

Name of the input data file to load by default.

◆ digitalAltHorizontalThreshold

float PlatformerPro.StandardInput.digitalAltHorizontalThreshold = 0.25f

Threshold for digital input to be considered non-zero.

◆ digitalAltVerticalThreshold

float PlatformerPro.StandardInput.digitalAltVerticalThreshold = 0.25f

Threshold for digital input to be considered non-zero.

◆ digitalHorizontalThreshold

float PlatformerPro.StandardInput.digitalHorizontalThreshold = 0.25f

Threshold for digital input to be considered non-zero.

◆ digitalVerticalThreshold

float PlatformerPro.StandardInput.digitalVerticalThreshold = 0.25f

Threshold for digital input to be considered non-zero.

◆ down

KeyCode PlatformerPro.StandardInput.down = KeyCode.DownArrow

The down key.

◆ enableController

bool PlatformerPro.StandardInput.enableController = true

Should the controller input be enabled.

◆ enableKeyboard

bool PlatformerPro.StandardInput.enableKeyboard = true

Should the keyboard input be enabled.

◆ forceButtonState

ButtonState [] PlatformerPro.StandardInput.forceButtonState
protected

Allow users to force a state for a given frame.

◆ horizontalAxisName

string PlatformerPro.StandardInput.horizontalAxisName = "Joystick1Axis1"

The horizontal controller axis.

◆ jump

KeyCode PlatformerPro.StandardInput.jump = KeyCode.Z

The jump key.

◆ lastDigitalAltHorizontalAxisState

int PlatformerPro.StandardInput.lastDigitalAltHorizontalAxisState
protected

Stores the last state of the alternate horizontal axis (digital).

◆ lastDigitalAltVerticalAxisState

int PlatformerPro.StandardInput.lastDigitalAltVerticalAxisState
protected

Stores the last state of the alternate vertical axis (digital).

◆ lastDigitalHorizontalAxisState

int PlatformerPro.StandardInput.lastDigitalHorizontalAxisState
protected

Stores the last state of the horizontal axis (digital).

◆ lastDigitalVerticalAxisState

int PlatformerPro.StandardInput.lastDigitalVerticalAxisState
protected

Stores the last state of the vertical axis (digital).

◆ left

KeyCode PlatformerPro.StandardInput.left = KeyCode.LeftArrow

The left key.

◆ pause

KeyCode PlatformerPro.StandardInput.pause = KeyCode.P

The pause key.

◆ reverseAltHorizontalAxis

bool PlatformerPro.StandardInput.reverseAltHorizontalAxis

Should we reverse the values of the horizontal axis.

◆ reverseAltVerticalAxis

bool PlatformerPro.StandardInput.reverseAltVerticalAxis

Should we reverse the values of the alternate vertival axis.

◆ reverseHorizontalAxis

bool PlatformerPro.StandardInput.reverseHorizontalAxis

Should we reverse the values of the horizontal axis.

◆ reverseVerticalAxis

bool PlatformerPro.StandardInput.reverseVerticalAxis

Should we reverse the values of the vertival axis.

◆ right

KeyCode PlatformerPro.StandardInput.right = KeyCode.RightArrow

The right key.

◆ run

KeyCode PlatformerPro.StandardInput.run = KeyCode.X

The run key.

◆ SavedPreferencePrefix

const string PlatformerPro.StandardInput.SavedPreferencePrefix = "PP.Input."
static

Constant used as a prefix for saving and loading input configuration from player prefs.

◆ up

KeyCode PlatformerPro.StandardInput.up = KeyCode.UpArrow

The up key.

◆ verticalAxisName

string PlatformerPro.StandardInput.verticalAxisName = "Joystick1Axis2"

The vertical controller axis.

Property Documentation

◆ ActionButton

override ButtonState PlatformerPro.StandardInput.ActionButton
get

State of the default action button. This could be pickup, attack, etc. If you need more buttons use the additional action use Input.GetActionButtonState()

◆ AltHorizontalAxis

override float? PlatformerPro.StandardInput.AltHorizontalAxis
get

A float value clamped between -1 for completely left and 1 for compeletely right. 0.5f would mean "half right". This implementation only returns -1.0f, 0.0f or 1.0f.

◆ AltHorizontalAxisDigital

override int?? PlatformerPro.StandardInput.AltHorizontalAxisDigital
get

A "digital" version of the horizontal axis in which the only valid values are -1 for LEFT, 0 for NONE, and 1 for RIGHT.

◆ AltHorizontalAxisState

override ButtonState PlatformerPro.StandardInput.AltHorizontalAxisState
get

Return ButtonState.DOWN if the axis state went from <= 0 to 1 or >= 0 to -1. Return ButtonState.HELD if the axis stayed at the same value and wasn't 0; Return ButtonState.UP if the axis state went from != 0 to 0.

◆ AltVerticalAxis

override float? PlatformerPro.StandardInput.AltVerticalAxis
get

A float value clamped between -1 for completely DOWN and 1 for completely UP. 0.5f would mean "half up". The exact interpretation of the values is up to the movement behaviours.

◆ AltVerticalAxisDigital

override int?? PlatformerPro.StandardInput.AltVerticalAxisDigital
get

A "digital" version of the alternate vertical axis in which the only valid values are -1 for DOWN, 0 for NONE, and 1 for UP.

◆ AltVerticalAxisState

override ButtonState PlatformerPro.StandardInput.AltVerticalAxisState
get

Return ButtonState.DOWN if the axis state went from <= 0 to 1 or >= 0 to -1. Return ButtonState.HELD if the axis stayed at the same value and wasn't 0; Return ButtonState.UP if the axis state went from != 0 to 0.

◆ AnyKey

override bool PlatformerPro.StandardInput.AnyKey
get

Returns true if any button or action key is being held.

true if any key; otherwise, false.

◆ Header

override string PlatformerPro.StandardInput.Header
get

Gets the header string used to describe the component.

The header.

◆ HorizontalAxis

override float? PlatformerPro.StandardInput.HorizontalAxis
get

A float value clamped between -1 for completely left and 1 for compeletely right. 0.5f would mean "half right". This implementation only returns -1.0f, 0.0f or 1.0f.

◆ HorizontalAxisDigital

override int?? PlatformerPro.StandardInput.HorizontalAxisDigital
get

A "digital" version of the horizontal axis in which the only valid values are -1 for LEFT, 0 for NONE, and 1 for RIGHT.

◆ HorizontalAxisState

override ButtonState PlatformerPro.StandardInput.HorizontalAxisState
get

Return ButtonState.DOWN if the axis state went from <= 0 to 1 or >= 0 to -1. Return ButtonState.HELD if the axis stayed at the same value and wasn't 0; Return ButtonState.UP if the axis state went from != 0 to 0.

◆ JumpButton

override ButtonState PlatformerPro.StandardInput.JumpButton
get

State of the jump button.

◆ PauseButton

override ButtonState PlatformerPro.StandardInput.PauseButton
get

State of the pause button.

◆ RunButton

override ButtonState PlatformerPro.StandardInput.RunButton
get

State of the run button.

◆ VerticalAxis

override float? PlatformerPro.StandardInput.VerticalAxis
get

A float value clamped between -1 for completely DOWN and 1 for completely UP. 0.5f would mean "half up". The exact interpretation of the values is up to the movement behaviours.

◆ VerticalAxisDigital

override int?? PlatformerPro.StandardInput.VerticalAxisDigital
get

A "digital" version of the vertical axis in which the only valid values are -1 for DOWN, 0 for NONE, and 1 for UP.

◆ VerticalAxisState

override ButtonState PlatformerPro.StandardInput.VerticalAxisState
get

Return ButtonState.DOWN if the axis state went from <= 0 to 1 or >= 0 to -1. Return ButtonState.HELD if the axis stayed at the same value and wasn't 0; Return ButtonState.UP if the axis state went from != 0 to 0.


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