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/Rigidbody2D/GetPosition.cs | |
parent | 97da432c35b8c7aaf9dd2c39e2aa4b1f55f36065 (diff) |
*更新Behaviour Designer版本,在最下版本有BUG
Diffstat (limited to 'Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody2D/GetPosition.cs')
-rw-r--r-- | Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody2D/GetPosition.cs | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody2D/GetPosition.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody2D/GetPosition.cs index 6b1c1c53..b22333ad 100644 --- a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody2D/GetPosition.cs +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody2D/GetPosition.cs @@ -8,8 +8,6 @@ namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityRigidbody2D {
[Tooltip("The GameObject that the task operates on. If null the task GameObject is used.")]
public SharedGameObject targetGameObject;
- [Tooltip("Can the target GameObject be empty?")]
- public SharedBool allowEmptyTarget;
[Tooltip("The velocity of the Rigidbody2D")]
[RequiredField]
public SharedVector2 storeValue;
@@ -19,12 +17,10 @@ namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityRigidbody2D public override void OnStart()
{
- if (!allowEmptyTarget.Value) {
- var currentGameObject = GetDefaultGameObject(targetGameObject.Value);
- if (currentGameObject != prevGameObject) {
- rigidbody2D = currentGameObject.GetComponent<Rigidbody2D>();
- prevGameObject = currentGameObject;
- }
+ var currentGameObject = GetDefaultGameObject(targetGameObject.Value);
+ if (currentGameObject != prevGameObject) {
+ rigidbody2D = currentGameObject.GetComponent<Rigidbody2D>();
+ prevGameObject = currentGameObject;
}
}
@@ -43,7 +39,6 @@ namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityRigidbody2D public override void OnReset()
{
targetGameObject = null;
- allowEmptyTarget = false;
storeValue = Vector2.zero;
}
}
|