Description
The OnTriggerExit
property of the HammerMesh
class is an event handler that is invoked when a collider exits the trigger area of the HammerMesh
component. This property is of type System.Action<Collider>
, allowing you to assign a method that takes a Collider
as a parameter to handle the event.
Usage
To use the OnTriggerExit
property, you need to assign a method that matches the System.Action<Collider>
delegate signature. This method will be called whenever a collider exits the trigger area of the HammerMesh
component. Ensure that the IsTrigger
property of the HammerMesh
is set to true
to enable trigger functionality.
Example
// Example of using the OnTriggerExit property
HammerMesh hammerMesh = new HammerMesh();
// Assign a method to handle the OnTriggerExit event
hammerMesh.OnTriggerExit = (collider) =>
{
// Handle the collider exiting the trigger
Log.Info($"Collider {collider.Name} exited the trigger.");
};
// Ensure the IsTrigger property is set to true
hammerMesh.IsTrigger = true;