All Classes Namespaces Functions Variables Enumerations Enumerator Properties
plyGame.plyInput Class Reference

plyGame Input manager More...

Inherits MonoBehaviour.

Static Public Member Functions

static void Init (GameObject parentObject, InputDefAsset asset)
 Initialise plyInput. The parentObject you specify should be a global that will not be destroyed during the life of the game running, else simply pass null and plyInput will create its own object. More...
 
static void Save ()
 Call to save the changes made to the buttons to PlayerPrefs or via SaveLoad provider. More...
 
static void Restore ()
 Call this only after having defined all buttons to read the changes that where saved to PlayerPrefs (or via SaveLoad provider) and overwrite any defaults assigned while defining the buttons. More...
 
static int DefineButton (InputDefinition def)
 Define a button from an input definition. Return index (idx) of new input or -1 on error. More...
 
static int GetInputIdx (string ident)
 Return the index (idx) of the defined button, -1 if not found. An def.ident is the combination of category and name for example: "Player/SelectNextTarget" More...
 
static bool IsActive (int idx)
 Return true if the input definition is active More...
 
static bool SimilarBinds (int idx1, int idx2)
 Return true if the inputs, identified by idx1 and idx2, use similar buttons or axis. More...
 
static bool GetButton (int idx)
 Returns true while the virtual button is held down. More...
 
static bool GetButtonDown (int idx)
 Returns true during the frame the user pressed down the virtual button identified by 'name'. More...
 
static bool GetButtonUp (int idx)
 Returns true the first frame the user releases the virtual button. More...
 
static float GetAxis (int idx)
 Returns the value of the virtual axis. More...
 
static float GetAxis (int idx1, int idx2)
 Returns the axis for input idx1. If it is 0 then the axis for input idx2 will be returned. More...
 

Protected Member Functions

void Awake ()
 
void LateUpdate ()
 

Properties

static bool MouseInputHandled [get, set]
 Set this to True in each frame that input from mouse was handled. Will be reset to False in LateUpdate() More...
 

Detailed Description

plyGame Input manager

Member Function Documentation

static int plyGame.plyInput.DefineButton ( InputDefinition  def)
static

Define a button from an input definition. Return index (idx) of new input or -1 on error.

static float plyGame.plyInput.GetAxis ( int  idx)
static

Returns the value of the virtual axis.

static float plyGame.plyInput.GetAxis ( int  idx1,
int  idx2 
)
static

Returns the axis for input idx1. If it is 0 then the axis for input idx2 will be returned.

static bool plyGame.plyInput.GetButton ( int  idx)
static

Returns true while the virtual button is held down.

static bool plyGame.plyInput.GetButtonDown ( int  idx)
static

Returns true during the frame the user pressed down the virtual button identified by 'name'.

static bool plyGame.plyInput.GetButtonUp ( int  idx)
static

Returns true the first frame the user releases the virtual button.

static int plyGame.plyInput.GetInputIdx ( string  ident)
static

Return the index (idx) of the defined button, -1 if not found. An def.ident is the combination of category and name for example: "Player/SelectNextTarget"

static void plyGame.plyInput.Init ( GameObject  parentObject,
InputDefAsset  asset 
)
static

Initialise plyInput. The parentObject you specify should be a global that will not be destroyed during the life of the game running, else simply pass null and plyInput will create its own object.

static bool plyGame.plyInput.IsActive ( int  idx)
static

Return true if the input definition is active

static void plyGame.plyInput.Restore ( )
static

Call this only after having defined all buttons to read the changes that where saved to PlayerPrefs (or via SaveLoad provider) and overwrite any defaults assigned while defining the buttons.

static void plyGame.plyInput.Save ( )
static

Call to save the changes made to the buttons to PlayerPrefs or via SaveLoad provider.

static bool plyGame.plyInput.SimilarBinds ( int  idx1,
int  idx2 
)
static

Return true if the inputs, identified by idx1 and idx2, use similar buttons or axis.

Property Documentation

bool plyGame.plyInput.MouseInputHandled
staticgetset

Set this to True in each frame that input from mouse was handled. Will be reset to False in LateUpdate()