diff options
author | chai <chaifix@163.com> | 2022-03-10 14:07:40 +0800 |
---|---|---|
committer | chai <chaifix@163.com> | 2022-03-10 14:07:40 +0800 |
commit | 22891bf59032ba88262824255a706d652031384b (patch) | |
tree | 7595439ba9966c9402d37e37cee5e8cf098757d5 /Assets/ThirdParty/Behavior Designer/Runtime/Conditionals/Physics/HasEnteredCollision2D.cs | |
parent | 8b04ea73e540067f83870b61d89db4868fea5e8a (diff) |
* move folder
Diffstat (limited to 'Assets/ThirdParty/Behavior Designer/Runtime/Conditionals/Physics/HasEnteredCollision2D.cs')
-rw-r--r-- | Assets/ThirdParty/Behavior Designer/Runtime/Conditionals/Physics/HasEnteredCollision2D.cs | 41 |
1 files changed, 0 insertions, 41 deletions
diff --git a/Assets/ThirdParty/Behavior Designer/Runtime/Conditionals/Physics/HasEnteredCollision2D.cs b/Assets/ThirdParty/Behavior Designer/Runtime/Conditionals/Physics/HasEnteredCollision2D.cs deleted file mode 100644 index 51feb050..00000000 --- a/Assets/ThirdParty/Behavior Designer/Runtime/Conditionals/Physics/HasEnteredCollision2D.cs +++ /dev/null @@ -1,41 +0,0 @@ -using UnityEngine;
-
-namespace BehaviorDesigner.Runtime.Tasks
-{
- [TaskDescription("Returns success when a 2D collision starts.")]
- [TaskCategory("Physics")]
- [HelpURL("http://www.opsive.com/assets/BehaviorDesigner/documentation.php?id=110")]
- public class HasEnteredCollision2D : Conditional
- {
- [Tooltip("The tag of the GameObject to check for a collision against")]
- public SharedString tag = "";
- [Tooltip("The object that started the collision")]
- public SharedGameObject collidedGameObject;
-
- private bool enteredCollision = false;
-
- public override TaskStatus OnUpdate()
- {
- return enteredCollision ? TaskStatus.Success : TaskStatus.Failure;
- }
-
- public override void OnEnd()
- {
- enteredCollision = false;
- }
-
- public override void OnCollisionEnter2D(Collision2D collision)
- {
- if (string.IsNullOrEmpty(tag.Value) || tag.Value.Equals(collision.gameObject.tag)) {
- collidedGameObject.Value = collision.gameObject;
- enteredCollision = true;
- }
- }
-
- public override void OnReset()
- {
- tag = "";
- collidedGameObject = null;
- }
- }
-}
|