FAST SDK Coding Reference 1.0.3
Loading...
Searching...
No Matches
KeyBinding Class Reference

Maps key presses to callbacks and actions. More...

Classes

class  ActiveState
 Defines an active key binding state. More...
 
class  ButtonKeyCommand
 Maps a key press to trigger a UI Button.onClick() event. More...
 
class  GameObjectKeyCommand
 Maps a key press to toggle a
GameObject active/inactive. More...
 
class  KeyCommand
 A base class for key presses and how they map to commands. More...
 
class  ToggleKeyCommand
 Maps a key press to toggle a UI Toggle on/off. More...
 
class  UnityEventKeyCommand
 Maps a key press to trigger a UnityEvent. More...
 

Public Member Functions

void AddKey (KeyCommand keyCommand)
 Allows you to add key press functionality at runtime.
 

Static Public Member Functions

static void SetDefaultState ()
 Change to the default FAST.KeyBinding.ActiveState.
 
static void SetPreviousState ()
 Change back to the previous FAST.KeyBinding.ActiveState.
 
static void SetState (string newState)
 Change the current FAST.KeyBinding.ActiveState.
 

Public Attributes

bool logKeys = false
 Inspector, Code
Set to true if the key press should be logged to the Editor Console or Player log.
 

Static Public Attributes

const string kDefaultState = "Default"
 The name of the default FAST.KeyBinding.ActiveState.
 

Private Attributes

List< ActiveStateactiveStates = new()
 Inspector
The list of states this key binding will apply to.
 
GameObjectKeyCommand[] gameObjectKeys
 Inspector
The list of key presses that will toggle GameObjects active/inactive.
 
bool isAlwaysActive
 Inspector
Set to true if this key binding should apply in all states.
 
ButtonKeyCommand[] uiButtonKeys
 Inspector
The list of key presses that will trigger UI Button.onClick() events.
 
ToggleKeyCommand[] uiToggleKeys
 Inspector
The list of key presses that will toggle UI Toggles on/off.
 
UnityEventKeyCommand[] unityEventKeys
 Inspector
The list of key presses that will trigger UnityEvent callbacks.
 

Detailed Description

Maps key presses to callbacks and actions.

Key binding FAST.KeyBinding.ActiveStates determine which contexts the key presses will apply.

Member Function Documentation

◆ AddKey()

void AddKey ( KeyCommand keyCommand)

Allows you to add key press functionality at runtime.

Parameters
keyCommandThe key press funtionality to add.

◆ SetDefaultState()

static void SetDefaultState ( )
static

Change to the default FAST.KeyBinding.ActiveState.

◆ SetPreviousState()

static void SetPreviousState ( )
static

Change back to the previous FAST.KeyBinding.ActiveState.

◆ SetState()

static void SetState ( string newState)
static

Change the current FAST.KeyBinding.ActiveState.

Parameters
newStateThe name of the new FAST.KeyBinding.ActiveState

Member Data Documentation

◆ activeStates

List<ActiveState> activeStates = new()
private

Inspector
The list of states this key binding will apply to.

Add named states to this list as needed using FAST.KeyBinding.StateType.Custom.

◆ gameObjectKeys

GameObjectKeyCommand [] gameObjectKeys
private

Inspector
The list of key presses that will toggle GameObjects active/inactive.

◆ isAlwaysActive

bool isAlwaysActive
private

Inspector
Set to true if this key binding should apply in all states.

◆ kDefaultState

const string kDefaultState = "Default"
static

The name of the default FAST.KeyBinding.ActiveState.

◆ logKeys

bool logKeys = false

Inspector, Code
Set to true if the key press should be logged to the Editor Console or Player log.

◆ uiButtonKeys

ButtonKeyCommand [] uiButtonKeys
private

Inspector
The list of key presses that will trigger UI Button.onClick() events.

◆ uiToggleKeys

ToggleKeyCommand [] uiToggleKeys
private

Inspector
The list of key presses that will toggle UI Toggles on/off.

◆ unityEventKeys

UnityEventKeyCommand [] unityEventKeys
private

Inspector
The list of key presses that will trigger UnityEvent callbacks.


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