EasyTalk API
|
This class implements the logic which handles player input controls for Dialogue Displays. More...
Inherits MonoBehaviour.
Private Member Functions | |
void | Awake () |
void | Update () |
The update loop handles user input if using the old input system. | |
void | OnDisable () |
Disables the player input controls on the dialogue display when using the new input system. | |
void | OnEnable () |
Enables the player input controls on the dialogue display when using the new input system. | |
bool | SelectOptionFromInputDirection () |
Checks the value of the x and y axis inputs and attempts to select the option in the corresponding direction. | |
void | HandleUserInput () |
Handles user input controls when using the old input system. | |
void | CheckToAllowAxisTriggering (float horizontal, float vertical, float axisActivationThreshold) |
Sets the allowAxisTrigger flag to true if enough time has passed or if the horizontal and vertical axis inputs have moved back down below the activation threshold. | |
void | HandleSelectOptionInDirection (float horizontal, float vertical, float axisActivationThreshold) |
When options are being presented to the player, this method attempts to select the option which corresponds to the current input axis direction (horizontal + vertical) if the axis control is allowed to be triggered. | |
void | HandleExitConversation () |
If 'allowQuickExit' is set to true, this method attempts to exit the dialogue conversation immediately whenever the input button mapped to 'quickExitButtonName' is pressed. | |
void | HandleChooseOption () |
When presenting options, this method attempts to finalize and choose the currently selected option whenever the input button mapped to 'chooseSelectedOptionButtonName' is pressed. | |
void | HandleSelectPreviousOption (float horizontal, float vertical, float axisActivationThreshold) |
When options are being presented to the player, this method attempts to select the previous option if the player is pressing the axis controls in the configured direction and the control is allowed to be triggered. | |
void | HandleSelectNextOption (float horizontal, float vertical, float axisActivationThreshold) |
When options are being presented to the player, this method attempts to select the next option if the player is pressing the axis controls in the configured direction and the control is allowed to be triggered. | |
float | GetDPadVerticalValue () |
Retrieves the vertical axis value from the player's input controls (uses the axis mapped to 'dpadVerticalAxisName'). This is intended for DPAD input, but can be used for any alternative axis. | |
float | GetDPadHorizontalValue () |
Retrieves the horizontal axis value from the player's input controls (uses the axis mapped to 'dpadHorizontalAxisName'). This is intended for DPAD input, but can be used for any alternative axis. | |
float | GetVerticalAxisValue () |
Retrieves the vertical axis value from the player's input controls (uses the axis mapped to 'verticalAxisName'). | |
float | GetHorizontalAxisValue () |
Retrieves the horizontal axis value from the player's input controls (uses the axis mapped to 'horizontalAxisName'). | |
void | HandleContinueButton () |
Checks to see if the player pressed the continue button. If they did and continuation is allowed, continues to the next part of the conversation. | |
Private Attributes | |
AbstractDialogueDisplay | dialogueDisplay |
The Dialogue Display to control. | |
string | continueButtonName = "Submit" |
The name of the input which triggers the dialogue to continue (only applicable when dialogue is being displayed). | |
string | chooseSelectedOptionButtonName = "Submit" |
The name of the input which chooses the currently selected option (only applicable when options are being presented). | |
string | quickExitButtonName = "Cancel" |
The name of the input which causes the dialogue to exit (only applicable when allowQuickExit is set to true). | |
string | horizontalAxisName = "Horizontal" |
The name of the horizontal input axis. This is used to select options when they are being shown. | |
string | dpadHorizontalAxisName = "DPAD_Horizontal" |
The name of the horizontal input axis for the DPAD. This is used to select options when they are being shown. | |
string | verticalAxisName = "Vertical" |
The name of the vertical input axis. This is used to select options when they are being shown. | |
string | dpadVerticalAxisName = "DPAD_Vertical" |
The name of the vertical input axis for the DPAD. This is used to select options when they are being shown. | |
float | axisResetTime = 0.3f |
The amount of time which must pass in order for the input axis controls to be usable again after a prior action is triggered (such as selecting an option). | |
bool | inputWarningSent = false |
A flag used to keep track of whether warning messages have been made when reading input so that messages aren't resent repeatedly during gameplay. | |
bool | allowAxisTrigger = false |
A flag indicating whether the axis controls are ready to be triggered to choose an option based on user input. | |
float | lastAxisTriggerTime |
Keeps track of the last time an input axis was triggered. | |
This class implements the logic which handles player input controls for Dialogue Displays.
|
private |
|
private |
Sets the allowAxisTrigger flag to true if enough time has passed or if the horizontal and vertical axis inputs have moved back down below the activation threshold.
horizontal | The horizontal axis input value. |
vertical | The vertical axis input value. |
axisActivationThreshold | The threshold value which the horizontal or vertical axis values must be below in order for allowAxisTrigger to be set to true (unless enough time has elapsed). |
|
private |
Retrieves the horizontal axis value from the player's input controls (uses the axis mapped to 'dpadHorizontalAxisName'). This is intended for DPAD input, but can be used for any alternative axis.
|
private |
Retrieves the vertical axis value from the player's input controls (uses the axis mapped to 'dpadVerticalAxisName'). This is intended for DPAD input, but can be used for any alternative axis.
|
private |
Retrieves the horizontal axis value from the player's input controls (uses the axis mapped to 'horizontalAxisName').
|
private |
Retrieves the vertical axis value from the player's input controls (uses the axis mapped to 'verticalAxisName').
|
private |
When presenting options, this method attempts to finalize and choose the currently selected option whenever the input button mapped to 'chooseSelectedOptionButtonName' is pressed.
|
private |
Checks to see if the player pressed the continue button. If they did and continuation is allowed, continues to the next part of the conversation.
|
private |
If 'allowQuickExit' is set to true, this method attempts to exit the dialogue conversation immediately whenever the input button mapped to 'quickExitButtonName' is pressed.
|
private |
When options are being presented to the player, this method attempts to select the next option if the player is pressing the axis controls in the configured direction and the control is allowed to be triggered.
horizontal | The horizontal axis input value. |
vertical | The vertical axis input value. |
axisActivationThreshold | The threshold value which the horizontal or vertical axis values must exceed in order for the action to be triggered. |
|
private |
When options are being presented to the player, this method attempts to select the option which corresponds to the current input axis direction (horizontal + vertical) if the axis control is allowed to be triggered.
horizontal | The horizontal axis input value. |
vertical | The vertical axis input value. |
axisActivationThreshold | The threshold value which the horizontal or vertical axis values must exceed in order for the action to be triggered. |
|
private |
When options are being presented to the player, this method attempts to select the previous option if the player is pressing the axis controls in the configured direction and the control is allowed to be triggered.
horizontal | The horizontal axis input value. |
vertical | The vertical axis input value. |
axisActivationThreshold | The threshold value which the horizontal or vertical axis values must exceed in order for the action to be triggered. |
|
private |
Handles user input controls when using the old input system.
|
private |
Disables the player input controls on the dialogue display when using the new input system.
|
private |
Enables the player input controls on the dialogue display when using the new input system.
|
private |
Checks the value of the x and y axis inputs and attempts to select the option in the corresponding direction.
|
private |
The update loop handles user input if using the old input system.
|
private |
A flag indicating whether the axis controls are ready to be triggered to choose an option based on user input.
|
private |
The amount of time which must pass in order for the input axis controls to be usable again after a prior action is triggered (such as selecting an option).
|
private |
The name of the input which chooses the currently selected option (only applicable when options are being presented).
|
private |
The name of the input which triggers the dialogue to continue (only applicable when dialogue is being displayed).
|
private |
The Dialogue Display to control.
|
private |
The name of the horizontal input axis for the DPAD. This is used to select options when they are being shown.
|
private |
The name of the vertical input axis for the DPAD. This is used to select options when they are being shown.
|
private |
The name of the horizontal input axis. This is used to select options when they are being shown.
|
private |
A flag used to keep track of whether warning messages have been made when reading input so that messages aren't resent repeatedly during gameplay.
|
private |
Keeps track of the last time an input axis was triggered.
|
private |
The name of the input which causes the dialogue to exit (only applicable when allowQuickExit is set to true).
|
private |
The name of the vertical input axis. This is used to select options when they are being shown.