Adventure Creator  1.79.1
An adventure game toolkit for Unity, by Chris Burton, ICEBOX Studios 2013-2022
AC.ActiveInput Class Reference

Public Member Functions

 ActiveInput (int[] idArray)
 
 ActiveInput (int _ID)
 A Constructor in which the unique identifier is explicitly set. More...
 
void SetDefaultState ()
 
bool TestForInput ()
 Tests if the associated input button is being pressed at the right time, and runs its associated ActionListAsset if it is More...
 
void ShowGUI ()
 

Static Public Member Functions

static void Upgrade ()
 
static string CreateSaveData (List< ActiveInput > activeInputs)
 Creates a save string containing the enabled state of a list of active inputs More...
 
static void LoadSaveData (string dataString)
 Restores the enabled states of the game's active inputs from a saved data string More...
 

Public Attributes

string label
 
int ID
 
string inputName
 
bool enabledOnStart = true
 
FlagsGameState gameStateFlags = FlagsGameState.Normal
 
ActionListAsset actionListAsset
 
SimulateInputType inputType = SimulateInputType.Button
 
float axisThreshold = 0.2f
 

Protected Types

enum  ActiveInputButtonType { OnButtonDown, OnButtonUp }
 

Protected Member Functions

bool TriggerIfStateMatches ()
 

Protected Attributes

ActiveInputButtonType buttonType = ActiveInputButtonType.OnButtonDown
 
bool isEnabled
 

Properties

bool IsEnabled [get, set]
 
string Label [get]
 

Detailed Description

A data container for active inputs, which map ActionListAssets to input buttons.

Constructor & Destructor Documentation

◆ ActiveInput() [1/2]

AC.ActiveInput.ActiveInput ( int[]  idArray)

The default Constructor.

◆ ActiveInput() [2/2]

AC.ActiveInput.ActiveInput ( int  _ID)

A Constructor in which the unique identifier is explicitly set.

Parameters
_IDThe unique identifier

Member Function Documentation

◆ CreateSaveData()

static string AC.ActiveInput.CreateSaveData ( List< ActiveInput activeInputs)
static

Creates a save string containing the enabled state of a list of active inputs

Parameters
activeInputsThe active inputs to save
Returns
The save string

◆ LoadSaveData()

static void AC.ActiveInput.LoadSaveData ( string  dataString)
static

Restores the enabled states of the game's active inputs from a saved data string

Parameters
dataStringThe data string to load

◆ SetDefaultState()

void AC.ActiveInput.SetDefaultState ( )

Sets the enabled state to the default value.

◆ TestForInput()

bool AC.ActiveInput.TestForInput ( )

Tests if the associated input button is being pressed at the right time, and runs its associated ActionListAsset if it is

◆ Upgrade()

static void AC.ActiveInput.Upgrade ( )
static

Upgrades all active inputs from previous releases

Member Data Documentation

◆ actionListAsset

ActionListAsset AC.ActiveInput.actionListAsset

The ActionListAsset to run when the input button is pressed

◆ axisThreshold

float AC.ActiveInput.axisThreshold = 0.2f

If inputType = SimulateInputType.Axis, the threshold value for the axis to trigger the ActionListAsset

◆ enabledOnStart

bool AC.ActiveInput.enabledOnStart = true

If True, the active input is enabled when the game begins

◆ gameStateFlags

FlagsGameState AC.ActiveInput.gameStateFlags = FlagsGameState.Normal

What GameStates this active input will be available for

◆ ID

int AC.ActiveInput.ID

A unique identifier

◆ inputName

string AC.ActiveInput.inputName

The name of the Input button, as defined in the Input Manager

◆ inputType

SimulateInputType AC.ActiveInput.inputType = SimulateInputType.Button

What type of input is expected (Button, Axis)

◆ label

string AC.ActiveInput.label

An Editor-friendly name

Property Documentation

◆ IsEnabled

bool AC.ActiveInput.IsEnabled
getset

The runtime enabled state of the active input