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

Wraps a standard input and allows you to define triggers as action buttons More...

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

Public Member Functions

override ButtonState GetActionButtonState (int index)
 Gets the state of the given action button. More...
 
- Public Member Functions inherited from PlatformerPro.StandardInput
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 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...
 

Properties

override ButtonState ActionButton [get]
 Gets the state of the default action button. More...
 
- Properties inherited from PlatformerPro.StandardInput
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...
 

Additional Inherited Members

- Public Attributes inherited from PlatformerPro.StandardInput
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 inherited from PlatformerPro.StandardInput
const string SavedPreferencePrefix = "PP.Input."
 Constant used as a prefix for saving and loading input configuration from player prefs. More...
 
- Protected Member Functions inherited from PlatformerPro.StandardInput
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 inherited from PlatformerPro.StandardInput
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...
 

Detailed Description

Wraps a standard input and allows you to define triggers as action buttons

Member Function Documentation

◆ GetActionButtonState()

override ButtonState PlatformerPro.TriggerAsButtonInput.GetActionButtonState ( int  index)
virtual

Gets the state of the given action button.

Returns
The action button.
Parameters
indexIndex.

Reimplemented from PlatformerPro.StandardInput.

Property Documentation

◆ ActionButton

override ButtonState PlatformerPro.TriggerAsButtonInput.ActionButton
get

Gets the state of the default action button.


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