Style Slasher
A dressup combat roguelike created by Scrungle Studios for the 2025 Swinburne Capstone project.
Slasher.Input.ButtonInputHandler Class Referenceabstract

A general InputHandler for button InputActions. More...

Inheritance diagram for Slasher.Input.ButtonInputHandler:
Inheritance graph
Collaboration diagram for Slasher.Input.ButtonInputHandler:
Collaboration graph

Public Member Functions

 ButtonInputHandler (string actionMapPath, string actionPath)
 
- Public Member Functions inherited from Slasher.Input.BaseInputHandler
 BaseInputHandler (string actionMapPath, string actionPath)
 

Protected Member Functions

override bool TryAddListeners ()
 Tries to add listeners, if they haven't been added already.
 
override bool TryRemoveListeners ()
 Tries to remove listeners, if they've been added.
 

Properties

override List< BaseInputReceiverreceivers [get]
 
- Properties inherited from Slasher.Input.BaseInputHandler
List< BaseInputReceiverreceivers [get]
 
InputAction inputAction [get]
 

Events

Action OnButtonPerformed [add, remove]
 Maps to the InputAction's .performed event.
 
Action< bool > OnInputStateChange [add, remove]
 Maps to the InputAction's .start event when true, and .cancelled event when false.
 

Private Member Functions

void OnInputStart (InputAction.CallbackContext context)
 
void OnInputPerformed (InputAction.CallbackContext context)
 
void OnInputCancelled (InputAction.CallbackContext context)
 

Private Attributes

InputReceiver inputPerformed = new()
 
InputReceiver< bool > inputState = new()
 
List< BaseInputReceiverreceiversBuffer
 

Detailed Description

A general InputHandler for button InputActions.

Constructor & Destructor Documentation

◆ ButtonInputHandler()

Slasher.Input.ButtonInputHandler.ButtonInputHandler ( string actionMapPath,
string actionPath )

Member Function Documentation

◆ OnInputCancelled()

void Slasher.Input.ButtonInputHandler.OnInputCancelled ( InputAction.CallbackContext context)
private

◆ OnInputPerformed()

void Slasher.Input.ButtonInputHandler.OnInputPerformed ( InputAction.CallbackContext context)
private

◆ OnInputStart()

void Slasher.Input.ButtonInputHandler.OnInputStart ( InputAction.CallbackContext context)
private

◆ TryAddListeners()

override bool Slasher.Input.ButtonInputHandler.TryAddListeners ( )
protectedvirtual

Tries to add listeners, if they haven't been added already.

Returns
If listeners were added. Listeners will not be added if they have already been added.

Reimplemented from Slasher.Input.BaseInputHandler.

Here is the call graph for this function:

◆ TryRemoveListeners()

override bool Slasher.Input.ButtonInputHandler.TryRemoveListeners ( )
protectedvirtual

Tries to remove listeners, if they've been added.

The buffered values of receivers are wiped when listeners are removed.

Returns
If listeners were removed. Listeners may not be removed if they haven't been added, or if any receivers still have any listeners for their Actions.

Reimplemented from Slasher.Input.BaseInputHandler.

Here is the call graph for this function:

Member Data Documentation

◆ inputPerformed

InputReceiver Slasher.Input.ButtonInputHandler.inputPerformed = new()
private

◆ inputState

InputReceiver<bool> Slasher.Input.ButtonInputHandler.inputState = new()
private

◆ receiversBuffer

List<BaseInputReceiver> Slasher.Input.ButtonInputHandler.receiversBuffer
private

Property Documentation

◆ receivers

override List<BaseInputReceiver> Slasher.Input.ButtonInputHandler.receivers
getprotected

Event Documentation

◆ OnButtonPerformed

Action Slasher.Input.ButtonInputHandler.OnButtonPerformed
addremove

Maps to the InputAction's .performed event.

◆ OnInputStateChange

Action<bool> Slasher.Input.ButtonInputHandler.OnInputStateChange
addremove

Maps to the InputAction's .start event when true, and .cancelled event when false.


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