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

Description

Implements input behaviour using Trigger Colliders.

The Trigger Event Handler is a convenience component to act on trigger events without programmer. It is a specific implementation of an EventHandler. It requires a Collider to be attached to the GameObject. It differs from the Collision Event Handler in that it uses trigger events and can also change ControllerInput.

The Event

The Trigger Event Handler can be placed on GameObjects to catch trigger events and execute functions when this happens.

The event type is as follows:

%Target Method Parameters

GameObject

When the Target Method takes a GameObject as parameter, the Target Method will receive the GameObject of the collider which is touching the trigger collider.

Boolean

When the Target Method takes a boolean parameter, a Constant value can be used or the parameter can be set to From Event. When the parameter is from the event, the integer is 1 when the collider is touching the trigger collider and 0 when not.

Integer

When the Target Method takes an integer (Int32) parameter, a Constant value can be used or the parameter can be set to From Event. When the parameter is from the event, the integer is 1 when the collider is touching the trigger collider and 0 when not.

Float

When the Target Method takes a float (Single) parameter, a Constant value can be used or the parameter can be set to From Event. When the parameter is from the event, the float value is 1.0 when the collider is touching the trigger collider and 0.0 when not.

%Controller Input

If the GameObject entering the trigger collider has Controller Input you can override the Controller Input while the GameObject is in the trigger collider. This enables you to assign a button to open a door when the player is close to that door for example.

The configuration is similar to the normal Controller Input. The difference is that empty entries do not override the Controller Input configuration. In the example above only the left Button 1 will be overridden, all other input will not be changed. When the GameObject leaves the trigger collider, the Controller Input is restored to the original configuration.

Inherits MonoBehaviour.

Public Attributes

GameObjectEventHandlers triggerHandlers
 Trigger Event Handles.
 
ControllerEventHandlers[] leftInputEvents
 
ControllerEventHandlers[] rightInputEvents
 

Protected Member Functions

virtual void OnTriggerEnter (Collider other)
 
virtual void OnTriggerExit (Collider other)
 

Protected Attributes

bool entered = false
 

Member Data Documentation

◆ triggerHandlers

GameObjectEventHandlers Passer.TriggerEventHandler.triggerHandlers
Initial value:
= new GameObjectEventHandlers() {
label = "Trigger Event",
tooltip =
"Call functions using the trigger collider state\n" +
"Parameter: the GameObject entering the trigger",
eventTypeLabels = new string[] {
"Never",
"On Trigger Enter",
"On Trigger Exit",
"On Trigger Stay",
"On Trigger Empty",
"On Trigger Change",
"Always"
},
}

Trigger Event Handles.

Let you execute function calls based on the Trigger Events

◆ leftInputEvents

ControllerEventHandlers [] Passer.TriggerEventHandler.leftInputEvents
Initial value:
= {
new ControllerEventHandlers() { label = "Left Vertical", id = 0 },
new ControllerEventHandlers() { label = "Left Horizontal", id = 1 },
new ControllerEventHandlers() { label = "Left Stick Button", id = 2 },
new ControllerEventHandlers() { label = "Left Button 1", id = 3 },
new ControllerEventHandlers() { label = "Left Button 2", id = 4 },
new ControllerEventHandlers() { label = "Left Button 3", id = 5 },
new ControllerEventHandlers() { label = "Left Button 4", id = 6 },
new ControllerEventHandlers() { label = "Left Trigger 1", id = 7 },
new ControllerEventHandlers() { label = "Left Trigger 2", id = 8 },
new ControllerEventHandlers() { label = "Left Option", id = 9 },
}
A list of EventHandlers for takeing care of controller input.
Definition ControllerEvent.cs:9

◆ rightInputEvents

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

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