Humanoid Control for Unity  v3
Passer.ControllerInput Class Reference

A unified method for using controller input More...

Inherits MonoBehaviour.

Public Types

enum  SideButton {
  StickVertical, StickHorizontal, StickButton, Button1,
  Button2, Button3, Button4, Trigger1,
  Trigger2, Option
}
 

Public Member Functions

ControllerEventHandlers GetInputEvent (bool isLeft, SideButton controllerButton)
 
void SetEventHandler (bool isLeft, SideButton sideButton, UnityAction< bool > boolEvent)
 

Static Public Member Functions

static void SetBoolMethod (GameObject gameObject, ControllerEventHandlers eventHandlers, EventHandler.Type eventType, UnityAction< bool > boolEvent)
 

Public Attributes

HumanoidControl humanoid
 
bool fingerMovements = true
 
GameControllers gameController
 The game controller type for this pawn More...
 
ControllerEventHandlers[] leftInputEvents
 
ControllerEventHandlers[] rightInputEvents
 

Protected Member Functions

virtual void Awake ()
 
virtual void Start ()
 
virtual void Update ()
 
void UpdateGameControllerInput ()
 
void UpdateInputList (ControllerEventHandlers inputEventList, float value)
 
void UpdateFingerMovements ()
 
void UpdateFingerMovementsSide (FingersTarget fingers, ControllerSide controllerSide)
 

Protected Attributes

PawnControl pawn
 
Humanoid.HandTarget leftHandTarget
 
Humanoid.HandTarget rightHandTarget
 
Controller controller
 

Static Protected Attributes

static string[] eventTypeLabels
 

Properties

float leftStickVertical [get]
 
float leftStickHorizontal [get]
 
float leftTrigger1 [get]
 
bool leftTrigger1Touched [get]
 
bool leftTrigger1Pressed [get]
 
float rightStickVertical [get]
 
float rightStickHorizontal [get]
 
float rightTrigger1 [get]
 
bool rightTrigger1Touched [get]
 
bool rightTrigger1Pressed [get]
 

Detailed Description

A unified method for using controller input

ControllerInput can be used to access the state and change of input buttons, touchpads and thumbsticks on any kind of input controller including game controllers and VR/XR controllers.

Member Data Documentation

◆ gameController

GameControllers Passer.ControllerInput.gameController

The game controller type for this pawn

◆ eventTypeLabels

string [] Passer.ControllerInput.eventTypeLabels
staticprotected
Initial value:
= new string[] {
"Never",
"On Press",
"On Release",
"While Down",
"While Up",
"On Change",
"Continuous"
}

◆ leftInputEvents

ControllerEventHandlers [] Passer.ControllerInput.leftInputEvents
Initial value:
= new ControllerEventHandlers[] {
new ControllerEventHandlers() { label = "Left Vertical", id = 0, defaultParameterProperty = "leftStickVertical" },
new ControllerEventHandlers() { label = "Left Horizontal", id = 1, defaultParameterProperty = "leftStickHorizontal" },
new ControllerEventHandlers() { label = "Left Stick Button", id = 2, eventTypeLabels = eventTypeLabels },
new ControllerEventHandlers() { label = "Left Button 1", id = 3, eventTypeLabels = eventTypeLabels },
new ControllerEventHandlers() { label = "Left Button 2", id = 4, eventTypeLabels = eventTypeLabels },
new ControllerEventHandlers() { label = "Left Button 3", id = 5, eventTypeLabels = eventTypeLabels },
new ControllerEventHandlers() { label = "Left Button 4", id = 6, eventTypeLabels = eventTypeLabels },
new ControllerEventHandlers() { label = "Left Trigger 1", id = 7, eventTypeLabels = eventTypeLabels },
new ControllerEventHandlers() { label = "Left Trigger 2", id = 8, eventTypeLabels = eventTypeLabels },
new ControllerEventHandlers() { label = "Left Option", id = 9, eventTypeLabels = eventTypeLabels },
}

◆ rightInputEvents

ControllerEventHandlers [] Passer.ControllerInput.rightInputEvents
Initial value:
= new ControllerEventHandlers[] {
new ControllerEventHandlers() { label = "Right Vertical", id = 0, eventTypeLabels = eventTypeLabels },
new ControllerEventHandlers() { label = "Right Horizontal", id = 1, eventTypeLabels = eventTypeLabels },
new ControllerEventHandlers() { label = "Right Stick Button", id = 2, eventTypeLabels = eventTypeLabels },
new ControllerEventHandlers() { label = "Right Button 1", id = 3, eventTypeLabels = eventTypeLabels },
new ControllerEventHandlers() { label = "Right Button 2", id = 4, eventTypeLabels = eventTypeLabels },
new ControllerEventHandlers() { label = "Right Button 3", id = 5, eventTypeLabels = eventTypeLabels },
new ControllerEventHandlers() { label = "Right Button 4", id = 6, eventTypeLabels = eventTypeLabels },
new ControllerEventHandlers() { label = "Right Trigger 1", id = 7, eventTypeLabels = eventTypeLabels },
new ControllerEventHandlers() { label = "Right Trigger 2", id = 8, eventTypeLabels = eventTypeLabels },
new ControllerEventHandlers() { label = "Right Option", id = 9, eventTypeLabels = eventTypeLabels },
}

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