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
1007 B
31 lines
1007 B
7 years ago
|
using UnityEngine;
|
||
|
using UnityEngine.UI;
|
||
|
|
||
|
namespace Fungus
|
||
|
{
|
||
|
/// <summary>
|
||
|
/// The block will execute when a 2d physics collision matching some basic conditions is met
|
||
|
/// </summary>
|
||
|
[EventHandlerInfo("MonoBehaviour",
|
||
|
"Collision2D",
|
||
|
"The block will execute when a 2d physics collision matching some basic conditions is met.")]
|
||
|
[AddComponentMenu("")]
|
||
|
public class Collision2D : BasePhysicsEventHandler
|
||
|
{
|
||
|
private void OnCollisionEnter2D(UnityEngine.Collision2D collision)
|
||
|
{
|
||
|
ProcessCollider(PhysicsMessageType.Enter, collision.collider.tag);
|
||
|
}
|
||
|
|
||
|
private void OnCollisionStay2D(UnityEngine.Collision2D collision)
|
||
|
{
|
||
|
ProcessCollider(PhysicsMessageType.Stay, collision.collider.tag);
|
||
|
}
|
||
|
|
||
|
private void OnCollisionExit2D(UnityEngine.Collision2D collision)
|
||
|
{
|
||
|
ProcessCollider(PhysicsMessageType.Exit, collision.collider.tag);
|
||
|
}
|
||
|
}
|
||
|
}
|