Humanoid Control for Unity v4
|
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 Trigger Event Handler can be placed on GameObjects to catch trigger events and execute functions when this happens.
The event type is as follows:
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.
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.
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.
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.
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 |
GameObjectEventHandlers Passer.TriggerEventHandler.triggerHandlers |
Trigger Event Handles.
Let you execute function calls based on the Trigger Events
ControllerEventHandlers [] Passer.TriggerEventHandler.leftInputEvents |
ControllerEventHandlers [] Passer.TriggerEventHandler.rightInputEvents |