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/Basic Tasks/Physics2D | |
parent | 8b04ea73e540067f83870b61d89db4868fea5e8a (diff) |
* move folder
Diffstat (limited to 'Assets/ThirdParty/Behavior Designer/Runtime/Basic Tasks/Physics2D')
6 files changed, 0 insertions, 198 deletions
diff --git a/Assets/ThirdParty/Behavior Designer/Runtime/Basic Tasks/Physics2D/Circlecast.cs b/Assets/ThirdParty/Behavior Designer/Runtime/Basic Tasks/Physics2D/Circlecast.cs deleted file mode 100644 index 516abc72..00000000 --- a/Assets/ThirdParty/Behavior Designer/Runtime/Basic Tasks/Physics2D/Circlecast.cs +++ /dev/null @@ -1,73 +0,0 @@ -using UnityEngine;
-
-namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityPhysics2D
-{
- [TaskCategory("Basic/Physics2D")]
- [TaskDescription("Casts a circle against all colliders in the scene. Returns success if a collider was hit.")]
- [HelpURL("http://www.opsive.com/assets/BehaviorDesigner/documentation.php?id=118")]
- public class Circlecast : Action
- {
- [Tooltip("Starts the circlecast at the GameObject's position. If null the originPosition will be used.")]
- public SharedGameObject originGameObject;
- [Tooltip("Starts the circlecast at the position. Only used if originGameObject is null.")]
- public SharedVector2 originPosition;
- [Tooltip("The radius of the circlecast")]
- public SharedFloat radius;
- [Tooltip("The direction of the circlecast")]
- public SharedVector2 direction;
- [Tooltip("The length of the ray. Set to -1 for infinity.")]
- public SharedFloat distance = -1;
- [Tooltip("Selectively ignore colliders.")]
- public LayerMask layerMask = -1;
- [Tooltip("Use world or local space. The direction is in world space if no GameObject is specified.")]
- public Space space = Space.Self;
-
- [SharedRequired]
- [Tooltip("Stores the hit object of the circlecast.")]
- public SharedGameObject storeHitObject;
- [SharedRequired]
- [Tooltip("Stores the hit point of the circlecast.")]
- public SharedVector2 storeHitPoint;
- [SharedRequired]
- [Tooltip("Stores the hit normal of the circlecast.")]
- public SharedVector2 storeHitNormal;
- [SharedRequired]
- [Tooltip("Stores the hit distance of the circlecast.")]
- public SharedFloat storeHitDistance;
-
- public override TaskStatus OnUpdate()
- {
- Vector2 position;
- Vector2 dir = direction.Value;
- if (originGameObject.Value != null) {
- position = originGameObject.Value.transform.position;
- if (space == Space.Self) {
- dir = originGameObject.Value.transform.TransformDirection(direction.Value);
- }
- } else {
- position = originPosition.Value;
- }
-
- var hit = Physics2D.CircleCast(position, radius.Value, dir, distance.Value == -1 ? Mathf.Infinity : distance.Value, layerMask);
- if (hit.collider != null) {
- storeHitObject.Value = hit.collider.gameObject;
- storeHitPoint.Value = hit.point;
- storeHitNormal.Value = hit.normal;
- storeHitDistance.Value = hit.distance;
- return TaskStatus.Success;
- }
- return TaskStatus.Failure;
- }
-
- public override void OnReset()
- {
- originGameObject = null;
- originPosition = Vector2.zero;
- direction = Vector2.zero;
- radius = 0;
- distance = -1;
- layerMask = -1;
- space = Space.Self;
- }
- }
-}
\ No newline at end of file diff --git a/Assets/ThirdParty/Behavior Designer/Runtime/Basic Tasks/Physics2D/Circlecast.cs.meta b/Assets/ThirdParty/Behavior Designer/Runtime/Basic Tasks/Physics2D/Circlecast.cs.meta deleted file mode 100644 index 541b96a0..00000000 --- a/Assets/ThirdParty/Behavior Designer/Runtime/Basic Tasks/Physics2D/Circlecast.cs.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2
-guid: 6989aa8730764ee459a07f88d84302e0
-MonoImporter:
- serializedVersion: 2
- defaultReferences: []
- executionOrder: 0
- icon: {instanceID: 0}
- userData:
diff --git a/Assets/ThirdParty/Behavior Designer/Runtime/Basic Tasks/Physics2D/Linecast.cs b/Assets/ThirdParty/Behavior Designer/Runtime/Basic Tasks/Physics2D/Linecast.cs deleted file mode 100644 index 914b6fee..00000000 --- a/Assets/ThirdParty/Behavior Designer/Runtime/Basic Tasks/Physics2D/Linecast.cs +++ /dev/null @@ -1,29 +0,0 @@ -using UnityEngine;
-
-namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityPhysics2D
-{
- [TaskCategory("Basic/Physics2D")]
- [TaskDescription("Returns success if there is any collider intersecting the line between start and end")]
- [HelpURL("http://www.opsive.com/assets/BehaviorDesigner/documentation.php?id=118")]
- public class Linecast : Action
- {
- [Tooltip("The starting position of the linecast.")]
- SharedVector2 startPosition;
- [Tooltip("The ending position of the linecast.")]
- SharedVector2 endPosition;
- [Tooltip("Selectively ignore colliders.")]
- public LayerMask layerMask = -1;
-
- public override TaskStatus OnUpdate()
- {
- return Physics2D.Linecast(startPosition.Value, endPosition.Value, layerMask) ? TaskStatus.Success : TaskStatus.Failure;
- }
-
- public override void OnReset()
- {
- startPosition = Vector2.zero;
- endPosition = Vector2.zero;
- layerMask = -1;
- }
- }
-}
diff --git a/Assets/ThirdParty/Behavior Designer/Runtime/Basic Tasks/Physics2D/Linecast.cs.meta b/Assets/ThirdParty/Behavior Designer/Runtime/Basic Tasks/Physics2D/Linecast.cs.meta deleted file mode 100644 index 6aa9170f..00000000 --- a/Assets/ThirdParty/Behavior Designer/Runtime/Basic Tasks/Physics2D/Linecast.cs.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2
-guid: a402dbfe872764f49b3a03d7048e866e
-MonoImporter:
- serializedVersion: 2
- defaultReferences: []
- executionOrder: 0
- icon: {instanceID: 0}
- userData:
diff --git a/Assets/ThirdParty/Behavior Designer/Runtime/Basic Tasks/Physics2D/Raycast.cs b/Assets/ThirdParty/Behavior Designer/Runtime/Basic Tasks/Physics2D/Raycast.cs deleted file mode 100644 index 2bc51b80..00000000 --- a/Assets/ThirdParty/Behavior Designer/Runtime/Basic Tasks/Physics2D/Raycast.cs +++ /dev/null @@ -1,72 +0,0 @@ -using UnityEngine;
-
-namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityPhysics2D
-{
- [TaskCategory("Basic/Physics2D")]
- [TaskDescription("Casts a ray against all colliders in the scene. Returns success if a collider was hit.")]
- [HelpURL("http://www.opsive.com/assets/BehaviorDesigner/documentation.php?id=118")]
- public class Raycast : Action
- {
- [Tooltip("Starts the ray at the GameObject's position. If null the originPosition will be used.")]
- public SharedGameObject originGameObject;
- [Tooltip("Starts the ray at the position. Only used if originGameObject is null.")]
- public SharedVector2 originPosition;
- [Tooltip("The direction of the ray")]
- public SharedVector2 direction;
- [Tooltip("The length of the ray. Set to -1 for infinity.")]
- public SharedFloat distance = -1;
- [Tooltip("Selectively ignore colliders.")]
- public LayerMask layerMask = -1;
- [Tooltip("Cast the ray in world or local space. The direction is in world space if no GameObject is specified.")]
- public Space space = Space.Self;
-
- [SharedRequired]
- [Tooltip("Stores the hit object of the raycast.")]
- public SharedGameObject storeHitObject;
- [SharedRequired]
- [Tooltip("Stores the hit point of the raycast.")]
- public SharedVector2 storeHitPoint;
- [SharedRequired]
- [Tooltip("Stores the hit normal of the raycast.")]
- public SharedVector2 storeHitNormal;
- [SharedRequired]
- [Tooltip("Stores the hit distance of the raycast.")]
- public SharedFloat storeHitDistance;
-
- public override TaskStatus OnUpdate()
- {
- Vector2 position;
- Vector2 dir = direction.Value;
- if (originGameObject.Value != null) {
- position = originGameObject.Value.transform.position;
- if (space == Space.Self) {
- dir = originGameObject.Value.transform.TransformDirection(direction.Value);
- }
- } else {
- position = originPosition.Value;
- }
-
- var hit = Physics2D.Raycast(position, dir, distance.Value == -1 ? Mathf.Infinity : distance.Value, layerMask);
- if (hit.collider != null) {
- storeHitObject.Value = hit.collider.gameObject;
- storeHitPoint.Value = hit.point;
- storeHitNormal.Value = hit.normal;
-#if !UNITY_4_3
- storeHitDistance.Value = hit.distance;
-#endif
- return TaskStatus.Success;
- }
- return TaskStatus.Failure;
- }
-
- public override void OnReset()
- {
- originGameObject = null;
- originPosition = Vector2.zero;
- direction = Vector2.zero;
- distance = -1;
- layerMask = -1;
- space = Space.Self;
- }
- }
-}
diff --git a/Assets/ThirdParty/Behavior Designer/Runtime/Basic Tasks/Physics2D/Raycast.cs.meta b/Assets/ThirdParty/Behavior Designer/Runtime/Basic Tasks/Physics2D/Raycast.cs.meta deleted file mode 100644 index f2f98446..00000000 --- a/Assets/ThirdParty/Behavior Designer/Runtime/Basic Tasks/Physics2D/Raycast.cs.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2
-guid: 513dc641bb68bcc4d9c3bdfb1ccc57b6
-MonoImporter:
- serializedVersion: 2
- defaultReferences: []
- executionOrder: 0
- icon: {instanceID: 0}
- userData:
|