summaryrefslogtreecommitdiff
path: root/Assets/ThirdParty/Behavior Designer/Runtime/Conditionals/Physics/HasEnteredTrigger2D.cs
diff options
context:
space:
mode:
authorchai <chaifix@163.com>2022-03-10 14:07:40 +0800
committerchai <chaifix@163.com>2022-03-10 14:07:40 +0800
commit22891bf59032ba88262824255a706d652031384b (patch)
tree7595439ba9966c9402d37e37cee5e8cf098757d5 /Assets/ThirdParty/Behavior Designer/Runtime/Conditionals/Physics/HasEnteredTrigger2D.cs
parent8b04ea73e540067f83870b61d89db4868fea5e8a (diff)
* move folder
Diffstat (limited to 'Assets/ThirdParty/Behavior Designer/Runtime/Conditionals/Physics/HasEnteredTrigger2D.cs')
-rw-r--r--Assets/ThirdParty/Behavior Designer/Runtime/Conditionals/Physics/HasEnteredTrigger2D.cs41
1 files changed, 0 insertions, 41 deletions
diff --git a/Assets/ThirdParty/Behavior Designer/Runtime/Conditionals/Physics/HasEnteredTrigger2D.cs b/Assets/ThirdParty/Behavior Designer/Runtime/Conditionals/Physics/HasEnteredTrigger2D.cs
deleted file mode 100644
index 05dfe9ec..00000000
--- a/Assets/ThirdParty/Behavior Designer/Runtime/Conditionals/Physics/HasEnteredTrigger2D.cs
+++ /dev/null
@@ -1,41 +0,0 @@
-using UnityEngine;
-
-namespace BehaviorDesigner.Runtime.Tasks
-{
- [TaskDescription("Returns success when an object enters the 2D trigger.")]
- [TaskCategory("Physics")]
- [HelpURL("http://www.opsive.com/assets/BehaviorDesigner/documentation.php?id=110")]
- public class HasEnteredTrigger2D : Conditional
- {
- [Tooltip("The tag of the GameObject to check for a trigger against")]
- public SharedString tag = "";
- [Tooltip("The object that entered the trigger")]
- public SharedGameObject otherGameObject;
-
- private bool enteredTrigger = false;
-
- public override TaskStatus OnUpdate()
- {
- return enteredTrigger ? TaskStatus.Success : TaskStatus.Failure;
- }
-
- public override void OnEnd()
- {
- enteredTrigger = false;
- }
-
- public override void OnTriggerEnter2D(Collider2D other)
- {
- if (string.IsNullOrEmpty(tag.Value) || tag.Value.Equals(other.gameObject.tag)) {
- otherGameObject.Value = other.gameObject;
- enteredTrigger = true;
- }
- }
-
- public override void OnReset()
- {
- tag = "";
- otherGameObject = null;
- }
- }
-}