Adventure Creator  1.66.8
An adventure game toolkit for Unity, by Chris Burton, ICEBOX Studios 2013-2018
AC.PlayerQTE Class Reference
Inheritance diagram for AC.PlayerQTE:

Public Member Functions

void OnAwake ()
 
QTEState GetState ()
 Gets the current QTE state (None, Win, Lose) More...
 
void SkipQTE ()
 
void StartSinglePressQTE (string _inputName, float _duration, Animator _animator=null, bool _wrongKeyFails=false)
 Begins a QTE that involves a single key being pressed to win. More...
 
void StartSingleAxisQTE (string _inputName, float _duration, float _axisThreshold, Animator _animator=null, bool _wrongKeyFails=false)
 Begins a QTE that involves a single axis being pressed to win. More...
 
void StartHoldKeyQTE (string _inputName, float _duration, float _holdDuration, Animator _animator=null, bool _wrongKeyFails=false)
 Begins a QTE that involves a single key being held down to win. More...
 
void StartButtonMashQTE (string _inputName, float _duration, int _targetPresses, bool _doCooldown, float _cooldownTime, Animator _animator=null, bool _wrongKeyFails=false)
 Begins a QTE that involves a single key being pressed repeatedly to win. More...
 
float GetRemainingTimeFactor ()
 Gets the time factor remaining in the current QTE, as a decimal. More...
 
float GetProgress ()
 Gets the progress made towards completing the current QTE, as a decimal. More...
 
bool QTEIsActive ()
 Checks if a QTE sequence is currently active. More...
 
void UpdateQTE ()
 

Detailed Description

This script handles the state, input and progress of Quick Time Events (QTEs). It should be attached to the GameEngine prefab.

Member Function Documentation

◆ GetProgress()

float AC.PlayerQTE.GetProgress ( )

Gets the progress made towards completing the current QTE, as a decimal.

Returns
The progress made towards competing the current QTE, as a decimal

◆ GetRemainingTimeFactor()

float AC.PlayerQTE.GetRemainingTimeFactor ( )

Gets the time factor remaining in the current QTE, as a decimal.

Returns
The time factor remaining in the current QTE, as a decimal

◆ GetState()

QTEState AC.PlayerQTE.GetState ( )

Gets the current QTE state (None, Win, Lose)

Returns
The current QTE state (None, Win, Lose)

◆ QTEIsActive()

bool AC.PlayerQTE.QTEIsActive ( )

Checks if a QTE sequence is currently active.

Returns
True if a QTE sequence is currently active.

◆ SkipQTE()

void AC.PlayerQTE.SkipQTE ( )

Automatically wins the current QTE.

◆ StartButtonMashQTE()

void AC.PlayerQTE.StartButtonMashQTE ( string  _inputName,
float  _duration,
int  _targetPresses,
bool  _doCooldown,
float  _cooldownTime,
Animator  _animator = null,
bool  _wrongKeyFails = false 
)

Begins a QTE that involves a single key being pressed repeatedly to win.

Parameters
_inputNameThe name of the input button that must be pressed repeatedly to win
_durationThe duration, in seconds, that the QTE lasts
_targetPressesThe number of times that the key must be pressed to win
_doCooldownIf True, then the number of registered key-presses will decrease over time
_cooldownTimeThe cooldown time, if _doCooldown = True
_animatorAn Animator that will be manipulated if it has "Hit", "Win" and "Lose" states
_wrongKeyFailsIf True, then pressing any key other than _inputName will instantly fail the QTE

◆ StartHoldKeyQTE()

void AC.PlayerQTE.StartHoldKeyQTE ( string  _inputName,
float  _duration,
float  _holdDuration,
Animator  _animator = null,
bool  _wrongKeyFails = false 
)

Begins a QTE that involves a single key being held down to win.

Parameters
_inputNameThe name of the input button that must be held down to win
_durationThe duration, in seconds, that the QTE lasts
_holdDurationThe duration, in seconds, that the key must be held down for
_animatorAn Animator that will be manipulated if it has "Win" and "Lose" states, and a "Held" trigger
_wrongKeyFailsIf True, then pressing any key other than _inputName will instantly fail the QTE

◆ StartSingleAxisQTE()

void AC.PlayerQTE.StartSingleAxisQTE ( string  _inputName,
float  _duration,
float  _axisThreshold,
Animator  _animator = null,
bool  _wrongKeyFails = false 
)

Begins a QTE that involves a single axis being pressed to win.

Parameters
_inputNameThe name of the input axis that must be pressed to win
_durationThe duration, in seconds, that the QTE lasts
_axisThresholdIf positive, the value that the input must be greater than for it to register as succesful. If positive, the input must be lower that this value.
_animatorAn Animator that will be manipulated if it has "Win" and "Lose" states
_wrongKeyFailsIf True, then pressing any axis other than _inputName will instantly fail the QTE

◆ StartSinglePressQTE()

void AC.PlayerQTE.StartSinglePressQTE ( string  _inputName,
float  _duration,
Animator  _animator = null,
bool  _wrongKeyFails = false 
)

Begins a QTE that involves a single key being pressed to win.

Parameters
_inputNameThe name of the input button that must be pressed to win
_durationThe duration, in seconds, that the QTE lasts
_animatorAn Animator that will be manipulated if it has "Win" and "Lose" states
_wrongKeyFailsIf True, then pressing any key other than _inputName will instantly fail the QTE

◆ UpdateQTE()

void AC.PlayerQTE.UpdateQTE ( )

Updates the current QTE. This is called every frame by StateHandler.