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
901 B
31 lines
901 B
using UnityEngine; |
|
using UnityEngine.UI; |
|
|
|
namespace Fungus |
|
{ |
|
/// <summary> |
|
/// The block will execute when a 2d physics trigger matching some basic conditions is met. |
|
/// </summary> |
|
[EventHandlerInfo("MonoBehaviour", |
|
"Trigger2D", |
|
"The block will execute when a 2d physics trigger matching some basic conditions is met.")] |
|
[AddComponentMenu("")] |
|
public class Trigger2D : BasePhysicsEventHandler |
|
{ |
|
private void OnTriggerEnter2D(Collider2D col) |
|
{ |
|
ProcessCollider(PhysicsMessageType.Enter, col.tag); |
|
} |
|
|
|
private void OnTriggerStay2D(Collider2D col) |
|
{ |
|
ProcessCollider(PhysicsMessageType.Stay, col.tag); |
|
} |
|
|
|
private void OnTriggerExit2D(Collider2D col) |
|
{ |
|
ProcessCollider(PhysicsMessageType.Exit, col.tag); |
|
} |
|
|
|
} |
|
}
|
|
|