Platformer Pro  2.3.2
A platform game kit for Unity.
PlatformerPro.Input Class Referenceabstract

Abstract defintion of what is required in an input class. More...

Inheritance diagram for PlatformerPro.Input:
PlatformerPro.PlatformerProMonoBehaviour PlatformerPro.BasicTouchInput PlatformerPro.BufferedInput PlatformerPro.DisabledInput PlatformerPro.MultiInput PlatformerPro.StandardInput PlatformerPro.UnityInput PlatformerPro.TriggerAsButtonInput

Public Member Functions

abstract ButtonState GetActionButtonState (int buttonIndex)
 Get the state of an action button. More...
 
abstract void ForceButtonState (int index, ButtonState state)
 Allow some external component to set button state (for current frame only). More...
 
abstract bool SetAxis (KeyType type, string axis, bool reverseAxis)
 Sets the joystick axis that corresponds to a Platform PRO input axis. More...
 
abstract bool SetKey (KeyType type, KeyCode keyCode)
 Sets the keyboayrd key that corresponds to a Platform PRO input key. More...
 
abstract bool SetKey (KeyType type, KeyCode keyCode, int keyNumber)
 Sets the keyboayrd key that corresponds to a Platform PRO input key. More...
 
abstract KeyCode GetKeyForType (KeyType type, int keyNumber)
 Gets the key code for the given type. More...
 
abstract string GetAxisForType (KeyType type)
 Gets the name of the axis for the given key type. More...
 
abstract bool SaveInputData ()
 Saves the input data. More...
 
abstract bool LoadInputData (string dataName)
 Loads the input data for the given data name. More...
 
abstract void LoadInputData (StandardInputData data)
 Loads the provided input data. More...
 
virtual void ConsumeJumpButton ()
 Consumes a jump button down event converting it in to a button held event. Does nothing if the button is in another state. More...
 
virtual void ConsumeRunButton ()
 Consumes a run button down event converting it in to a button held event. Does nothing if the button is in another state. More...
 
virtual void ConsumeActionButton (int index)
 Consumes an action button down event converting it in to a button held event. Does nothing if the button is in another state. 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

int playerId
 The player who is assigned to this input. More...
 

Properties

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

Abstract defintion of what is required in an input class.

Member Function Documentation

◆ ConsumeActionButton()

virtual void PlatformerPro.Input.ConsumeActionButton ( int  index)
virtual

Consumes an action button down event converting it in to a button held event. Does nothing if the button is in another state.

Reimplemented in PlatformerPro.StandardInput, PlatformerPro.MultiInput, and PlatformerPro.BufferedInput.

◆ ConsumeJumpButton()

virtual void PlatformerPro.Input.ConsumeJumpButton ( )
virtual

Consumes a jump button down event converting it in to a button held event. Does nothing if the button is in another state.

Reimplemented in PlatformerPro.StandardInput, PlatformerPro.MultiInput, and PlatformerPro.BufferedInput.

◆ ConsumeRunButton()

virtual void PlatformerPro.Input.ConsumeRunButton ( )
virtual

Consumes a run button down event converting it in to a button held event. Does nothing if the button is in another state.

Reimplemented in PlatformerPro.StandardInput, PlatformerPro.MultiInput, and PlatformerPro.BufferedInput.

◆ ForceButtonState()

abstract void PlatformerPro.Input.ForceButtonState ( int  index,
ButtonState  state 
)
pure virtual

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

Parameters
indexIndex.
stateState.

Implemented in PlatformerPro.UnityInput, PlatformerPro.BasicTouchInput, PlatformerPro.StandardInput, PlatformerPro.MultiInput, PlatformerPro.DisabledInput, and PlatformerPro.BufferedInput.

◆ GetActionButtonState()

abstract ButtonState PlatformerPro.Input.GetActionButtonState ( int  buttonIndex)
pure virtual

Get the state of an action button.

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

Implemented in PlatformerPro.TriggerAsButtonInput, PlatformerPro.UnityInput, PlatformerPro.BasicTouchInput, PlatformerPro.StandardInput, PlatformerPro.MultiInput, PlatformerPro.DisabledInput, and PlatformerPro.BufferedInput.

◆ GetAxisForType()

abstract string PlatformerPro.Input.GetAxisForType ( KeyType  type)
pure virtual

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

Returns
The axis name.
Parameters
typeType.

Implemented in PlatformerPro.UnityInput, PlatformerPro.BasicTouchInput, PlatformerPro.StandardInput, PlatformerPro.MultiInput, PlatformerPro.DisabledInput, and PlatformerPro.BufferedInput.

◆ GetKeyForType()

abstract KeyCode PlatformerPro.Input.GetKeyForType ( KeyType  type,
int  keyNumber 
)
pure 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).

Implemented in PlatformerPro.UnityInput, PlatformerPro.BasicTouchInput, PlatformerPro.StandardInput, PlatformerPro.MultiInput, PlatformerPro.DisabledInput, and PlatformerPro.BufferedInput.

◆ LoadInputData() [1/2]

abstract void PlatformerPro.Input.LoadInputData ( StandardInputData  data)
pure virtual

◆ LoadInputData() [2/2]

abstract bool PlatformerPro.Input.LoadInputData ( string  dataName)
pure virtual

Loads the input data for the given data name.

Returns
true, if input data was loaded, false otherwise.
Parameters
dataNameData to load.

Implemented in PlatformerPro.UnityInput, PlatformerPro.BasicTouchInput, PlatformerPro.StandardInput, PlatformerPro.MultiInput, PlatformerPro.DisabledInput, and PlatformerPro.BufferedInput.

◆ SaveInputData()

abstract bool PlatformerPro.Input.SaveInputData ( )
pure virtual

Saves the input data.

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

Implemented in PlatformerPro.UnityInput, PlatformerPro.BasicTouchInput, PlatformerPro.StandardInput, PlatformerPro.MultiInput, PlatformerPro.DisabledInput, and PlatformerPro.BufferedInput.

◆ SetAxis()

abstract bool PlatformerPro.Input.SetAxis ( KeyType  type,
string  axis,
bool  reverseAxis 
)
pure 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 axis values be reversed.

Implemented in PlatformerPro.UnityInput, PlatformerPro.BasicTouchInput, PlatformerPro.StandardInput, PlatformerPro.MultiInput, PlatformerPro.DisabledInput, and PlatformerPro.BufferedInput.

◆ SetKey() [1/2]

abstract bool PlatformerPro.Input.SetKey ( KeyType  type,
KeyCode  keyCode 
)
pure 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.

Implemented in PlatformerPro.UnityInput, PlatformerPro.BasicTouchInput, PlatformerPro.StandardInput, PlatformerPro.MultiInput, PlatformerPro.DisabledInput, and PlatformerPro.BufferedInput.

◆ SetKey() [2/2]

abstract bool PlatformerPro.Input.SetKey ( KeyType  type,
KeyCode  keyCode,
int  keyNumber 
)
pure 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 or ignored if not setting an action key

Implemented in PlatformerPro.UnityInput, PlatformerPro.BasicTouchInput, PlatformerPro.StandardInput, PlatformerPro.MultiInput, PlatformerPro.DisabledInput, and PlatformerPro.BufferedInput.

Member Data Documentation

◆ playerId

int PlatformerPro.Input.playerId

The player who is assigned to this input.

Property Documentation

◆ ActionButton

abstract ButtonState PlatformerPro.Input.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()

The crouch button.

◆ AltHorizontalAxis

abstract float PlatformerPro.Input.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.

◆ AltHorizontalAxisDigital

abstract int PlatformerPro.Input.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.

◆ AltHorizontalAxisState

abstract ButtonState PlatformerPro.Input.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.

◆ AltVerticalAxis

abstract float PlatformerPro.Input.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

abstract int PlatformerPro.Input.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.

◆ AltVerticalAxisState

abstract ButtonState PlatformerPro.Input.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.

◆ AnyKey

abstract bool PlatformerPro.Input.AnyKey
get

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

true if any key; otherwise, false.

◆ HorizontalAxis

abstract float PlatformerPro.Input.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.

◆ HorizontalAxisDigital

abstract int PlatformerPro.Input.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

abstract ButtonState PlatformerPro.Input.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.

◆ JumpButton

abstract ButtonState PlatformerPro.Input.JumpButton
get

State of the jump button.

The jump button.

◆ PauseButton

abstract ButtonState PlatformerPro.Input.PauseButton
get

State of the pause button.

The pause button.

◆ RunButton

abstract ButtonState PlatformerPro.Input.RunButton
get

State of the run button.

The run button.

◆ VerticalAxis

abstract float PlatformerPro.Input.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

abstract int PlatformerPro.Input.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.

◆ VerticalAxisState

abstract ButtonState PlatformerPro.Input.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.


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