diff options
author | chai <chaifix@163.com> | 2021-01-27 16:30:19 +0800 |
---|---|---|
committer | chai <chaifix@163.com> | 2021-01-27 16:30:19 +0800 |
commit | 6ee18886c8af3858de5e97599b23086823d9f320 (patch) | |
tree | aed86a8c4887586d976410ecd3d14789b2ee3583 /Client/Assets/Behavior Designer/Runtime/Basic Tasks/BoxCollider2D | |
parent | 97da432c35b8c7aaf9dd2c39e2aa4b1f55f36065 (diff) |
*更新Behaviour Designer版本,在最下版本有BUG
Diffstat (limited to 'Client/Assets/Behavior Designer/Runtime/Basic Tasks/BoxCollider2D')
6 files changed, 16 insertions, 125 deletions
diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/BoxCollider2D/GetCenter.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/BoxCollider2D/GetCenter.cs deleted file mode 100644 index 60c05b77..00000000 --- a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/BoxCollider2D/GetCenter.cs +++ /dev/null @@ -1,47 +0,0 @@ -#if UNITY_4_6 || UNITY_4_7
-using UnityEngine;
-
-namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityBoxCollider2D
-{
- [TaskCategory("Basic/BoxCollider2D")]
- [TaskDescription("Stores the center of the BoxCollider2D. Returns Success.")]
- public class GetCenter : Action
- {
- [Tooltip("The GameObject that the task operates on. If null the task GameObject is used.")]
- public SharedGameObject targetGameObject;
- [Tooltip("The center of the BoxCollider2D")]
- [RequiredField]
- public SharedVector2 storeValue;
-
- private BoxCollider2D boxCollider2D;
- private GameObject prevGameObject;
-
- public override void OnStart()
- {
- var currentGameObject = GetDefaultGameObject(targetGameObject.Value);
- if (currentGameObject != prevGameObject) {
- boxCollider2D = currentGameObject.GetComponent<BoxCollider2D>();
- prevGameObject = currentGameObject;
- }
- }
-
- public override TaskStatus OnUpdate()
- {
- if (boxCollider2D == null) {
- Debug.LogWarning("BoxCollider2D is null");
- return TaskStatus.Failure;
- }
-
- storeValue.Value = boxCollider2D.center;
-
- return TaskStatus.Success;
- }
-
- public override void OnReset()
- {
- targetGameObject = null;
- storeValue = Vector2.zero;
- }
- }
-}
-#endif
\ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/BoxCollider2D/GetCenter.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/BoxCollider2D/GetCenter.cs.meta deleted file mode 100644 index 87ce1000..00000000 --- a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/BoxCollider2D/GetCenter.cs.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2
-guid: 97045dc4cff50664994b74ec1d41dfb9
-MonoImporter:
- serializedVersion: 2
- defaultReferences: []
- executionOrder: 0
- icon: {instanceID: 0}
- userData:
diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/BoxCollider2D/GetSize.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/BoxCollider2D/GetSize.cs.meta index 362df45f..84ef28ce 100644 --- a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/BoxCollider2D/GetSize.cs.meta +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/BoxCollider2D/GetSize.cs.meta @@ -1,8 +1,8 @@ -fileFormatVersion: 2
-guid: c69113b787759f340aacbb9d99a6d654
-MonoImporter:
- serializedVersion: 2
- defaultReferences: []
- executionOrder: 0
- icon: {instanceID: 0}
- userData:
+fileFormatVersion: 2 +guid: c69113b787759f340aacbb9d99a6d654 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/BoxCollider2D/SetCenter.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/BoxCollider2D/SetCenter.cs deleted file mode 100644 index f6c74d1c..00000000 --- a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/BoxCollider2D/SetCenter.cs +++ /dev/null @@ -1,46 +0,0 @@ -#if UNITY_4_6 || UNITY_4_7
-using UnityEngine;
-
-namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityBoxCollider2D
-{
- [TaskCategory("Basic/BoxCollider2D")]
- [TaskDescription("Sets the center of the BoxCollider2D. Returns Success.")]
- public class SetCenter : Action
- {
- [Tooltip("The GameObject that the task operates on. If null the task GameObject is used.")]
- public SharedGameObject targetGameObject;
- [Tooltip("The center of the BoxCollider2D")]
- public SharedVector2 center;
-
- private BoxCollider2D boxCollider2D;
- private GameObject prevGameObject;
-
- public override void OnStart()
- {
- var currentGameObject = GetDefaultGameObject(targetGameObject.Value);
- if (currentGameObject != prevGameObject) {
- boxCollider2D = currentGameObject.GetComponent<BoxCollider2D>();
- prevGameObject = currentGameObject;
- }
- }
-
- public override TaskStatus OnUpdate()
- {
- if (boxCollider2D == null) {
- Debug.LogWarning("BoxCollider2D is null");
- return TaskStatus.Failure;
- }
-
- boxCollider2D.center = center.Value;
-
- return TaskStatus.Success;
- }
-
- public override void OnReset()
- {
- targetGameObject = null;
- center = Vector2.zero;
- }
- }
-}
-#endif
\ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/BoxCollider2D/SetCenter.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/BoxCollider2D/SetCenter.cs.meta deleted file mode 100644 index 70e26e5b..00000000 --- a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/BoxCollider2D/SetCenter.cs.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2
-guid: beddee09fde7fe24b894ef43edc1998a
-MonoImporter:
- serializedVersion: 2
- defaultReferences: []
- executionOrder: 0
- icon: {instanceID: 0}
- userData:
diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/BoxCollider2D/SetSize.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/BoxCollider2D/SetSize.cs.meta index f5af4e82..661d126b 100644 --- a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/BoxCollider2D/SetSize.cs.meta +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/BoxCollider2D/SetSize.cs.meta @@ -1,8 +1,8 @@ -fileFormatVersion: 2
-guid: 1875fd00045d98848b028015a17aeeaf
-MonoImporter:
- serializedVersion: 2
- defaultReferences: []
- executionOrder: 0
- icon: {instanceID: 0}
- userData:
+fileFormatVersion: 2 +guid: 1875fd00045d98848b028015a17aeeaf +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: |