An easy to use Unity 3D library for creating illustrated Interactive Fiction games and more.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

31 lines
876 B

using UnityEngine;
using UnityEngine.UI;
namespace Fungus
{
/// <summary>
/// The block will execute when a 3d physics trigger matching some basic conditions is met.
/// </summary>
[EventHandlerInfo("MonoBehaviour",
"Trigger",
"The block will execute when a 3d physics trigger matching some basic conditions is met.")]
[AddComponentMenu("")]
public class Trigger : BasePhysicsEventHandler
{
private void OnTriggerEnter(Collider col)
{
ProcessCollider(PhysicsMessageType.Enter, col.tag);
}
private void OnTriggerStay(Collider col)
{
ProcessCollider(PhysicsMessageType.Stay, col.tag);
}
private void OnTriggerExit(Collider col)
{
ProcessCollider(PhysicsMessageType.Exit, col.tag);
}
}
}