Humanoid Control for Unity v4
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | Static Protected Attributes | Properties | List of all members
Passer.ControllerInput Class Reference

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.

%Controllers

You can assign controller buttons to certain functions. Controller input is split into a left and right side. For some controllers, this corresponds to the left or right controller (e.g. SteamVR or Oculus Touch controllers). For game controllers like the Xbox controller, this corresponds to the left and right side of the gamepad. Event input is using an EventHandler to define its behaviour.

Inherits MonoBehaviour.

Public Types

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

Public Member Functions

void InitializeLeftInputEvents ()
 
void InitializeRightInputEvents ()
 
ControllerEventHandlers GetInputEvent (bool isLeft, SideButton controllerButton)
 
void SetEventHandler (bool isLeft, SideButton sideButton, UnityAction< bool > boolEvent)
 
void SetRightTrigger1Value (float value)
 

Static Public Member Functions

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

Public Attributes

HumanoidControl humanoid
 
bool fingerMovements = true
 Enables a built-in support for finger movements from the controller buttons.
 
GameControllers gameController
 Selects which controller type is showed in the Inspector.
 
ControllerEventHandlers[] leftInputEvents
 
ControllerEventHandlers[] rightInputEvents
 

Protected Member Functions

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

Protected Attributes

HandTarget leftHandTarget
 
HandTarget rightHandTarget
 
Controller controller
 

Static Protected Attributes

static string[] eventTypeLabels
 

Properties

float leftStickVertical [get]
 
float leftStickHorizontal [get]
 
bool leftStickPressed [get]
 
float leftTouchpadVertical [get]
 
float leftTouchpadHorizontal [get]
 
bool leftTouchpadPressed [get]
 
float leftTrigger1 [get]
 
bool leftTrigger1Touched [get]
 
bool leftTrigger1Pressed [get]
 
float leftTrigger2 [get]
 
bool leftTrigger2Touched [get]
 
bool leftTrigger2Pressed [get]
 
bool leftButton1Pressed [get]
 
bool leftButton2Pressed [get]
 
bool leftButton3Pressed [get]
 
bool leftButton4Pressed [get]
 
bool leftOptionPressed [get]
 
float rightStickVertical [get]
 
float rightStickHorizontal [get]
 
bool rightStickPressed [get]
 
float rightTouchpadVertical [get]
 
float rightTouchpadHorizontal [get]
 
bool rightTouchpadPressed [get]
 
float rightTrigger1 [get]
 
bool rightTrigger1Touched [get]
 
bool rightTrigger1Pressed [get]
 
float rightTrigger2 [get]
 
bool rightTrigger2Touched [get]
 
bool rightTrigger2Pressed [get]
 
bool rightButton1Pressed [get]
 
bool rightButton2Pressed [get]
 
bool rightButton3Pressed [get]
 
bool rightButton4Pressed [get]
 
bool rightOptionPressed [get]
 

Member Data Documentation

◆ fingerMovements

bool Passer.ControllerInput.fingerMovements = true

Enables a built-in support for finger movements from the controller buttons.

This option is only available when the Controller Input Component is attached to an Humanoid.

◆ gameController

GameControllers Passer.ControllerInput.gameController

Selects which controller type is showed in the Inspector.

his setting has no effect on the working of the Controller Input. It helps to determine how the actions are assigned to buttons or various supported controllers.

◆ eventTypeLabels

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

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