From 21e186f75b504d832d9c7bef0456edd7d5d3155e Mon Sep 17 00:00:00 2001 From: chai Date: Wed, 8 Sep 2021 10:52:35 +0800 Subject: +behavior design --- .../Basic Tasks/GameObject/ActiveInHierarchy.cs | 22 +++++++++++++++ .../GameObject/ActiveInHierarchy.cs.meta | 8 ++++++ .../Runtime/Basic Tasks/GameObject/ActiveSelf.cs | 22 +++++++++++++++ .../Basic Tasks/GameObject/ActiveSelf.cs.meta | 8 ++++++ .../Runtime/Basic Tasks/GameObject/CompareTag.cs | 25 ++++++++++++++++ .../Basic Tasks/GameObject/CompareTag.cs.meta | 8 ++++++ .../Runtime/Basic Tasks/GameObject/Destroy.cs | 32 +++++++++++++++++++++ .../Runtime/Basic Tasks/GameObject/Destroy.cs.meta | 8 ++++++ .../Basic Tasks/GameObject/DestroyImmediate.cs | 25 ++++++++++++++++ .../GameObject/DestroyImmediate.cs.meta | 8 ++++++ .../Runtime/Basic Tasks/GameObject/Find.cs | 28 ++++++++++++++++++ .../Runtime/Basic Tasks/GameObject/Find.cs.meta | 8 ++++++ .../GameObject/FindGameObjectsWithTag.cs | 31 ++++++++++++++++++++ .../GameObject/FindGameObjectsWithTag.cs.meta | 8 ++++++ .../Runtime/Basic Tasks/GameObject/FindWithTag.cs | 28 ++++++++++++++++++ .../Basic Tasks/GameObject/FindWithTag.cs.meta | 8 ++++++ .../Runtime/Basic Tasks/GameObject/GetComponent.cs | 31 ++++++++++++++++++++ .../Basic Tasks/GameObject/GetComponent.cs.meta | 8 ++++++ .../Runtime/Basic Tasks/GameObject/GetTag.cs | 28 ++++++++++++++++++ .../Runtime/Basic Tasks/GameObject/GetTag.cs.meta | 8 ++++++ .../Runtime/Basic Tasks/GameObject/Instantiate.cs | 33 ++++++++++++++++++++++ .../Basic Tasks/GameObject/Instantiate.cs.meta | 8 ++++++ .../Runtime/Basic Tasks/GameObject/SendMessage.cs | 33 ++++++++++++++++++++++ .../Basic Tasks/GameObject/SendMessage.cs.meta | 8 ++++++ .../Runtime/Basic Tasks/GameObject/SetActive.cs | 27 ++++++++++++++++++ .../Basic Tasks/GameObject/SetActive.cs.meta | 8 ++++++ .../Runtime/Basic Tasks/GameObject/SetTag.cs | 27 ++++++++++++++++++ .../Runtime/Basic Tasks/GameObject/SetTag.cs.meta | 8 ++++++ 28 files changed, 504 insertions(+) create mode 100644 Assets/ThirdParty/Behavior Designer/Runtime/Basic Tasks/GameObject/ActiveInHierarchy.cs create mode 100644 Assets/ThirdParty/Behavior Designer/Runtime/Basic Tasks/GameObject/ActiveInHierarchy.cs.meta create mode 100644 Assets/ThirdParty/Behavior Designer/Runtime/Basic Tasks/GameObject/ActiveSelf.cs create mode 100644 Assets/ThirdParty/Behavior Designer/Runtime/Basic Tasks/GameObject/ActiveSelf.cs.meta create mode 100644 Assets/ThirdParty/Behavior Designer/Runtime/Basic Tasks/GameObject/CompareTag.cs create mode 100644 Assets/ThirdParty/Behavior Designer/Runtime/Basic Tasks/GameObject/CompareTag.cs.meta create mode 100644 Assets/ThirdParty/Behavior Designer/Runtime/Basic Tasks/GameObject/Destroy.cs create mode 100644 Assets/ThirdParty/Behavior Designer/Runtime/Basic Tasks/GameObject/Destroy.cs.meta create mode 100644 Assets/ThirdParty/Behavior Designer/Runtime/Basic Tasks/GameObject/DestroyImmediate.cs create mode 100644 Assets/ThirdParty/Behavior Designer/Runtime/Basic Tasks/GameObject/DestroyImmediate.cs.meta create mode 100644 Assets/ThirdParty/Behavior Designer/Runtime/Basic Tasks/GameObject/Find.cs create mode 100644 Assets/ThirdParty/Behavior Designer/Runtime/Basic Tasks/GameObject/Find.cs.meta create mode 100644 Assets/ThirdParty/Behavior Designer/Runtime/Basic Tasks/GameObject/FindGameObjectsWithTag.cs create mode 100644 Assets/ThirdParty/Behavior Designer/Runtime/Basic Tasks/GameObject/FindGameObjectsWithTag.cs.meta create mode 100644 Assets/ThirdParty/Behavior Designer/Runtime/Basic Tasks/GameObject/FindWithTag.cs create mode 100644 Assets/ThirdParty/Behavior Designer/Runtime/Basic Tasks/GameObject/FindWithTag.cs.meta create mode 100644 Assets/ThirdParty/Behavior Designer/Runtime/Basic Tasks/GameObject/GetComponent.cs create mode 100644 Assets/ThirdParty/Behavior Designer/Runtime/Basic Tasks/GameObject/GetComponent.cs.meta create mode 100644 Assets/ThirdParty/Behavior Designer/Runtime/Basic Tasks/GameObject/GetTag.cs create mode 100644 Assets/ThirdParty/Behavior Designer/Runtime/Basic Tasks/GameObject/GetTag.cs.meta create mode 100644 Assets/ThirdParty/Behavior Designer/Runtime/Basic Tasks/GameObject/Instantiate.cs create mode 100644 Assets/ThirdParty/Behavior Designer/Runtime/Basic Tasks/GameObject/Instantiate.cs.meta create mode 100644 Assets/ThirdParty/Behavior Designer/Runtime/Basic Tasks/GameObject/SendMessage.cs create mode 100644 Assets/ThirdParty/Behavior Designer/Runtime/Basic Tasks/GameObject/SendMessage.cs.meta create mode 100644 Assets/ThirdParty/Behavior Designer/Runtime/Basic Tasks/GameObject/SetActive.cs create mode 100644 Assets/ThirdParty/Behavior Designer/Runtime/Basic Tasks/GameObject/SetActive.cs.meta create mode 100644 Assets/ThirdParty/Behavior Designer/Runtime/Basic Tasks/GameObject/SetTag.cs create mode 100644 Assets/ThirdParty/Behavior Designer/Runtime/Basic Tasks/GameObject/SetTag.cs.meta (limited to 'Assets/ThirdParty/Behavior Designer/Runtime/Basic Tasks/GameObject') diff --git a/Assets/ThirdParty/Behavior Designer/Runtime/Basic Tasks/GameObject/ActiveInHierarchy.cs b/Assets/ThirdParty/Behavior Designer/Runtime/Basic Tasks/GameObject/ActiveInHierarchy.cs new file mode 100644 index 00000000..e1beca39 --- /dev/null +++ b/Assets/ThirdParty/Behavior Designer/Runtime/Basic Tasks/GameObject/ActiveInHierarchy.cs @@ -0,0 +1,22 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityGameObject +{ + [TaskCategory("Basic/GameObject")] + [TaskDescription("Returns Success if the GameObject is active in the hierarchy, otherwise Failure.")] + public class ActiveInHierarchy : Conditional + { + [Tooltip("The GameObject that the task operates on. If null the task GameObject is used.")] + public SharedGameObject targetGameObject; + + public override TaskStatus OnUpdate() + { + return GetDefaultGameObject(targetGameObject.Value).activeInHierarchy ? TaskStatus.Success : TaskStatus.Failure; + } + + public override void OnReset() + { + targetGameObject = null; + } + } +} \ No newline at end of file diff --git a/Assets/ThirdParty/Behavior Designer/Runtime/Basic Tasks/GameObject/ActiveInHierarchy.cs.meta b/Assets/ThirdParty/Behavior Designer/Runtime/Basic Tasks/GameObject/ActiveInHierarchy.cs.meta new file mode 100644 index 00000000..10414adf --- /dev/null +++ b/Assets/ThirdParty/Behavior Designer/Runtime/Basic Tasks/GameObject/ActiveInHierarchy.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 0bbe57db7a21ee94f86aef75bbcd6d18 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Assets/ThirdParty/Behavior Designer/Runtime/Basic Tasks/GameObject/ActiveSelf.cs b/Assets/ThirdParty/Behavior Designer/Runtime/Basic Tasks/GameObject/ActiveSelf.cs new file mode 100644 index 00000000..37945765 --- /dev/null +++ b/Assets/ThirdParty/Behavior Designer/Runtime/Basic Tasks/GameObject/ActiveSelf.cs @@ -0,0 +1,22 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityGameObject +{ + [TaskCategory("Basic/GameObject")] + [TaskDescription("Returns Success if the GameObject is active in the hierarchy, otherwise Failure.")] + public class ActiveSelf : Conditional + { + [Tooltip("The GameObject that the task operates on. If null the task GameObject is used.")] + public SharedGameObject targetGameObject; + + public override TaskStatus OnUpdate() + { + return GetDefaultGameObject(targetGameObject.Value).activeSelf ? TaskStatus.Success : TaskStatus.Failure; + } + + public override void OnReset() + { + targetGameObject = null; + } + } +} \ No newline at end of file diff --git a/Assets/ThirdParty/Behavior Designer/Runtime/Basic Tasks/GameObject/ActiveSelf.cs.meta b/Assets/ThirdParty/Behavior Designer/Runtime/Basic Tasks/GameObject/ActiveSelf.cs.meta new file mode 100644 index 00000000..a367c1b1 --- /dev/null +++ b/Assets/ThirdParty/Behavior Designer/Runtime/Basic Tasks/GameObject/ActiveSelf.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 26a4530d0ecaa774aaf060511089ddc3 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Assets/ThirdParty/Behavior Designer/Runtime/Basic Tasks/GameObject/CompareTag.cs b/Assets/ThirdParty/Behavior Designer/Runtime/Basic Tasks/GameObject/CompareTag.cs new file mode 100644 index 00000000..86e676af --- /dev/null +++ b/Assets/ThirdParty/Behavior Designer/Runtime/Basic Tasks/GameObject/CompareTag.cs @@ -0,0 +1,25 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityGameObject +{ + [TaskCategory("Basic/GameObject")] + [TaskDescription("Returns Success if tags match, otherwise Failure.")] + public class CompareTag : Conditional + { + [Tooltip("The GameObject that the task operates on. If null the task GameObject is used.")] + public SharedGameObject targetGameObject; + [Tooltip("The tag to compare against")] + public SharedString tag; + + public override TaskStatus OnUpdate() + { + return GetDefaultGameObject(targetGameObject.Value).CompareTag(tag.Value) ? TaskStatus.Success : TaskStatus.Failure; + } + + public override void OnReset() + { + targetGameObject = null; + tag = ""; + } + } +} \ No newline at end of file diff --git a/Assets/ThirdParty/Behavior Designer/Runtime/Basic Tasks/GameObject/CompareTag.cs.meta b/Assets/ThirdParty/Behavior Designer/Runtime/Basic Tasks/GameObject/CompareTag.cs.meta new file mode 100644 index 00000000..471d827f --- /dev/null +++ b/Assets/ThirdParty/Behavior Designer/Runtime/Basic Tasks/GameObject/CompareTag.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: fa50c2eedc866794890ff361bdd1d593 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Assets/ThirdParty/Behavior Designer/Runtime/Basic Tasks/GameObject/Destroy.cs b/Assets/ThirdParty/Behavior Designer/Runtime/Basic Tasks/GameObject/Destroy.cs new file mode 100644 index 00000000..659157b5 --- /dev/null +++ b/Assets/ThirdParty/Behavior Designer/Runtime/Basic Tasks/GameObject/Destroy.cs @@ -0,0 +1,32 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityGameObject +{ + [TaskCategory("Basic/GameObject")] + [TaskDescription("Destorys the specified GameObject. Returns Success.")] + public class Destroy : Action + { + [Tooltip("The GameObject that the task operates on. If null the task GameObject is used.")] + public SharedGameObject targetGameObject; + [Tooltip("Time to destroy the GameObject in")] + public float time; + + public override TaskStatus OnUpdate() + { + var destroyGameObject = GetDefaultGameObject(targetGameObject.Value); + if (time == 0) { + GameObject.Destroy(destroyGameObject); + } else { + GameObject.Destroy(destroyGameObject, time); + } + + return TaskStatus.Success; + } + + public override void OnReset() + { + targetGameObject = null; + time = 0; + } + } +} \ No newline at end of file diff --git a/Assets/ThirdParty/Behavior Designer/Runtime/Basic Tasks/GameObject/Destroy.cs.meta b/Assets/ThirdParty/Behavior Designer/Runtime/Basic Tasks/GameObject/Destroy.cs.meta new file mode 100644 index 00000000..0426b237 --- /dev/null +++ b/Assets/ThirdParty/Behavior Designer/Runtime/Basic Tasks/GameObject/Destroy.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 42a90ad4cba90604b8be494aa74df349 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Assets/ThirdParty/Behavior Designer/Runtime/Basic Tasks/GameObject/DestroyImmediate.cs b/Assets/ThirdParty/Behavior Designer/Runtime/Basic Tasks/GameObject/DestroyImmediate.cs new file mode 100644 index 00000000..22338483 --- /dev/null +++ b/Assets/ThirdParty/Behavior Designer/Runtime/Basic Tasks/GameObject/DestroyImmediate.cs @@ -0,0 +1,25 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityGameObject +{ + [TaskCategory("Basic/GameObject")] + [TaskDescription("Destorys the specified GameObject immediately. Returns Success.")] + public class DestroyImmediate : Action + { + [Tooltip("The GameObject that the task operates on. If null the task GameObject is used.")] + public SharedGameObject targetGameObject; + + public override TaskStatus OnUpdate() + { + var destroyGameObject = GetDefaultGameObject(targetGameObject.Value); + GameObject.DestroyImmediate(destroyGameObject); + + return TaskStatus.Success; + } + + public override void OnReset() + { + targetGameObject = null; + } + } +} \ No newline at end of file diff --git a/Assets/ThirdParty/Behavior Designer/Runtime/Basic Tasks/GameObject/DestroyImmediate.cs.meta b/Assets/ThirdParty/Behavior Designer/Runtime/Basic Tasks/GameObject/DestroyImmediate.cs.meta new file mode 100644 index 00000000..dfca4dbd --- /dev/null +++ b/Assets/ThirdParty/Behavior Designer/Runtime/Basic Tasks/GameObject/DestroyImmediate.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 81f8712bcbdbdbf4aad17ba5e1e20d8c +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Assets/ThirdParty/Behavior Designer/Runtime/Basic Tasks/GameObject/Find.cs b/Assets/ThirdParty/Behavior Designer/Runtime/Basic Tasks/GameObject/Find.cs new file mode 100644 index 00000000..067adeed --- /dev/null +++ b/Assets/ThirdParty/Behavior Designer/Runtime/Basic Tasks/GameObject/Find.cs @@ -0,0 +1,28 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityGameObject +{ + [TaskCategory("Basic/GameObject")] + [TaskDescription("Finds a GameObject by name. Returns Success.")] + public class Find : Action + { + [Tooltip("The GameObject name to find")] + public SharedString gameObjectName; + [Tooltip("The object found by name")] + [RequiredField] + public SharedGameObject storeValue; + + public override TaskStatus OnUpdate() + { + storeValue.Value = GameObject.Find(gameObjectName.Value); + + return TaskStatus.Success; + } + + public override void OnReset() + { + gameObjectName = null; + storeValue = null; + } + } +} \ No newline at end of file diff --git a/Assets/ThirdParty/Behavior Designer/Runtime/Basic Tasks/GameObject/Find.cs.meta b/Assets/ThirdParty/Behavior Designer/Runtime/Basic Tasks/GameObject/Find.cs.meta new file mode 100644 index 00000000..729c7c7d --- /dev/null +++ b/Assets/ThirdParty/Behavior Designer/Runtime/Basic Tasks/GameObject/Find.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 5388c9a6fc7770f44885176c24f68aaa +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Assets/ThirdParty/Behavior Designer/Runtime/Basic Tasks/GameObject/FindGameObjectsWithTag.cs b/Assets/ThirdParty/Behavior Designer/Runtime/Basic Tasks/GameObject/FindGameObjectsWithTag.cs new file mode 100644 index 00000000..db02e1bd --- /dev/null +++ b/Assets/ThirdParty/Behavior Designer/Runtime/Basic Tasks/GameObject/FindGameObjectsWithTag.cs @@ -0,0 +1,31 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityGameObject +{ + [TaskCategory("Basic/GameObject")] + [TaskDescription("Finds a GameObject by tag. Returns Success.")] + public class FindGameObjectsWithTag : Action + { + [Tooltip("The tag of the GameObject to find")] + public SharedString tag; + [Tooltip("The objects found by name")] + [RequiredField] + public SharedGameObjectList storeValue; + + public override TaskStatus OnUpdate() + { + var gameObjects = GameObject.FindGameObjectsWithTag(tag.Value); + for (int i = 0; i < gameObjects.Length; ++i) { + storeValue.Value.Add(gameObjects[i]); + } + + return TaskStatus.Success; + } + + public override void OnReset() + { + tag.Value = null; + storeValue.Value = null; + } + } +} \ No newline at end of file diff --git a/Assets/ThirdParty/Behavior Designer/Runtime/Basic Tasks/GameObject/FindGameObjectsWithTag.cs.meta b/Assets/ThirdParty/Behavior Designer/Runtime/Basic Tasks/GameObject/FindGameObjectsWithTag.cs.meta new file mode 100644 index 00000000..51a2649d --- /dev/null +++ b/Assets/ThirdParty/Behavior Designer/Runtime/Basic Tasks/GameObject/FindGameObjectsWithTag.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: ccc3e1d2bf7cfc74089c17d593472f98 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Assets/ThirdParty/Behavior Designer/Runtime/Basic Tasks/GameObject/FindWithTag.cs b/Assets/ThirdParty/Behavior Designer/Runtime/Basic Tasks/GameObject/FindWithTag.cs new file mode 100644 index 00000000..35a0ef63 --- /dev/null +++ b/Assets/ThirdParty/Behavior Designer/Runtime/Basic Tasks/GameObject/FindWithTag.cs @@ -0,0 +1,28 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityGameObject +{ + [TaskCategory("Basic/GameObject")] + [TaskDescription("Finds a GameObject by tag. Returns Success.")] + public class FindWithTag : Action + { + [Tooltip("The tag of the GameObject to find")] + public SharedString tag; + [Tooltip("The object found by name")] + [RequiredField] + public SharedGameObject storeValue; + + public override TaskStatus OnUpdate() + { + storeValue.Value = GameObject.FindWithTag(tag.Value); + + return TaskStatus.Success; + } + + public override void OnReset() + { + tag.Value = null; + storeValue.Value = null; + } + } +} \ No newline at end of file diff --git a/Assets/ThirdParty/Behavior Designer/Runtime/Basic Tasks/GameObject/FindWithTag.cs.meta b/Assets/ThirdParty/Behavior Designer/Runtime/Basic Tasks/GameObject/FindWithTag.cs.meta new file mode 100644 index 00000000..c12ea132 --- /dev/null +++ b/Assets/ThirdParty/Behavior Designer/Runtime/Basic Tasks/GameObject/FindWithTag.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: d8768bdf841982f4aae662ee5dac3f2d +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Assets/ThirdParty/Behavior Designer/Runtime/Basic Tasks/GameObject/GetComponent.cs b/Assets/ThirdParty/Behavior Designer/Runtime/Basic Tasks/GameObject/GetComponent.cs new file mode 100644 index 00000000..96069ed8 --- /dev/null +++ b/Assets/ThirdParty/Behavior Designer/Runtime/Basic Tasks/GameObject/GetComponent.cs @@ -0,0 +1,31 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityGameObject +{ + [TaskCategory("Basic/GameObject")] + [TaskDescription("Returns the component of Type type if the game object has one attached, null if it doesn't. Returns Success.")] + public class GetComponent : Action + { + [Tooltip("The GameObject that the task operates on. If null the task GameObject is used.")] + public SharedGameObject targetGameObject; + [Tooltip("The type of component")] + public SharedString type; + [Tooltip("The component")] + [RequiredField] + public SharedObject storeValue; + + public override TaskStatus OnUpdate() + { + storeValue.Value = GetDefaultGameObject(targetGameObject.Value).GetComponent(type.Value); + + return TaskStatus.Success; + } + + public override void OnReset() + { + targetGameObject = null; + type.Value = ""; + storeValue.Value = null; + } + } +} \ No newline at end of file diff --git a/Assets/ThirdParty/Behavior Designer/Runtime/Basic Tasks/GameObject/GetComponent.cs.meta b/Assets/ThirdParty/Behavior Designer/Runtime/Basic Tasks/GameObject/GetComponent.cs.meta new file mode 100644 index 00000000..6d3bbf91 --- /dev/null +++ b/Assets/ThirdParty/Behavior Designer/Runtime/Basic Tasks/GameObject/GetComponent.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 46e3dd9b1b260584b893abde5f733359 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Assets/ThirdParty/Behavior Designer/Runtime/Basic Tasks/GameObject/GetTag.cs b/Assets/ThirdParty/Behavior Designer/Runtime/Basic Tasks/GameObject/GetTag.cs new file mode 100644 index 00000000..6392cb5c --- /dev/null +++ b/Assets/ThirdParty/Behavior Designer/Runtime/Basic Tasks/GameObject/GetTag.cs @@ -0,0 +1,28 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityGameObject +{ + [TaskCategory("Basic/GameObject")] + [TaskDescription("Stores the GameObject tag. Returns Success.")] + public class GetTag : Action + { + [Tooltip("The GameObject that the task operates on. If null the task GameObject is used.")] + public SharedGameObject targetGameObject; + [Tooltip("Active state of the GameObject")] + [RequiredField] + public SharedString storeValue; + + public override TaskStatus OnUpdate() + { + storeValue.Value = GetDefaultGameObject(targetGameObject.Value).tag; + + return TaskStatus.Success; + } + + public override void OnReset() + { + targetGameObject = null; + storeValue = ""; + } + } +} \ No newline at end of file diff --git a/Assets/ThirdParty/Behavior Designer/Runtime/Basic Tasks/GameObject/GetTag.cs.meta b/Assets/ThirdParty/Behavior Designer/Runtime/Basic Tasks/GameObject/GetTag.cs.meta new file mode 100644 index 00000000..03efe771 --- /dev/null +++ b/Assets/ThirdParty/Behavior Designer/Runtime/Basic Tasks/GameObject/GetTag.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 44bf3273a8802dc408352f165f18c541 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Assets/ThirdParty/Behavior Designer/Runtime/Basic Tasks/GameObject/Instantiate.cs b/Assets/ThirdParty/Behavior Designer/Runtime/Basic Tasks/GameObject/Instantiate.cs new file mode 100644 index 00000000..61f53469 --- /dev/null +++ b/Assets/ThirdParty/Behavior Designer/Runtime/Basic Tasks/GameObject/Instantiate.cs @@ -0,0 +1,33 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityGameObject +{ + [TaskCategory("Basic/GameObject")] + [TaskDescription("Instantiates a new GameObject. Returns Success.")] + public class Instantiate : Action + { + [Tooltip("The GameObject that the task operates on. If null the task GameObject is used.")] + public SharedGameObject targetGameObject; + [Tooltip("The position of the new GameObject")] + public SharedVector3 position; + [Tooltip("The rotation of the new GameObject")] + public SharedQuaternion rotation = Quaternion.identity; + [SharedRequired] + [Tooltip("The instantiated GameObject")] + public SharedGameObject storeResult; + + public override TaskStatus OnUpdate() + { + storeResult.Value = GameObject.Instantiate(targetGameObject.Value, position.Value, rotation.Value) as GameObject; + + return TaskStatus.Success; + } + + public override void OnReset() + { + targetGameObject = null; + position = Vector3.zero; + rotation = Quaternion.identity; + } + } +} \ No newline at end of file diff --git a/Assets/ThirdParty/Behavior Designer/Runtime/Basic Tasks/GameObject/Instantiate.cs.meta b/Assets/ThirdParty/Behavior Designer/Runtime/Basic Tasks/GameObject/Instantiate.cs.meta new file mode 100644 index 00000000..fc324f10 --- /dev/null +++ b/Assets/ThirdParty/Behavior Designer/Runtime/Basic Tasks/GameObject/Instantiate.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 804a64515d87a0546ad7c6c4408ed53f +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Assets/ThirdParty/Behavior Designer/Runtime/Basic Tasks/GameObject/SendMessage.cs b/Assets/ThirdParty/Behavior Designer/Runtime/Basic Tasks/GameObject/SendMessage.cs new file mode 100644 index 00000000..87819e46 --- /dev/null +++ b/Assets/ThirdParty/Behavior Designer/Runtime/Basic Tasks/GameObject/SendMessage.cs @@ -0,0 +1,33 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityGameObject +{ + [TaskCategory("Basic/GameObject")] + [TaskDescription("Sends a message to the target GameObject. Returns Success.")] + public class SendMessage : Action + { + [Tooltip("The GameObject that the task operates on. If null the task GameObject is used.")] + public SharedGameObject targetGameObject; + [Tooltip("The message to send")] + public SharedString message; + [Tooltip("The value to send")] + public SharedGenericVariable value; + + public override TaskStatus OnUpdate() + { + if (value.Value != null) { + GetDefaultGameObject(targetGameObject.Value).SendMessage(message.Value, value.Value.value.GetValue()); + } else { + GetDefaultGameObject(targetGameObject.Value).SendMessage(message.Value); + } + + return TaskStatus.Success; + } + + public override void OnReset() + { + targetGameObject = null; + message = ""; + } + } +} \ No newline at end of file diff --git a/Assets/ThirdParty/Behavior Designer/Runtime/Basic Tasks/GameObject/SendMessage.cs.meta b/Assets/ThirdParty/Behavior Designer/Runtime/Basic Tasks/GameObject/SendMessage.cs.meta new file mode 100644 index 00000000..7eee6459 --- /dev/null +++ b/Assets/ThirdParty/Behavior Designer/Runtime/Basic Tasks/GameObject/SendMessage.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: dd0f144b1db34024eaea548f6539d2ae +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Assets/ThirdParty/Behavior Designer/Runtime/Basic Tasks/GameObject/SetActive.cs b/Assets/ThirdParty/Behavior Designer/Runtime/Basic Tasks/GameObject/SetActive.cs new file mode 100644 index 00000000..c3cbd84f --- /dev/null +++ b/Assets/ThirdParty/Behavior Designer/Runtime/Basic Tasks/GameObject/SetActive.cs @@ -0,0 +1,27 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityGameObject +{ + [TaskCategory("Basic/GameObject")] + [TaskDescription("Activates/Deactivates the GameObject. Returns Success.")] + public class SetActive : Action + { + [Tooltip("The GameObject that the task operates on. If null the task GameObject is used.")] + public SharedGameObject targetGameObject; + [Tooltip("Active state of the GameObject")] + public SharedBool active; + + public override TaskStatus OnUpdate() + { + GetDefaultGameObject(targetGameObject.Value).SetActive(active.Value); + + return TaskStatus.Success; + } + + public override void OnReset() + { + targetGameObject = null; + active = false; + } + } +} \ No newline at end of file diff --git a/Assets/ThirdParty/Behavior Designer/Runtime/Basic Tasks/GameObject/SetActive.cs.meta b/Assets/ThirdParty/Behavior Designer/Runtime/Basic Tasks/GameObject/SetActive.cs.meta new file mode 100644 index 00000000..58907327 --- /dev/null +++ b/Assets/ThirdParty/Behavior Designer/Runtime/Basic Tasks/GameObject/SetActive.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 5237a810dcce11e499c1915171ec670b +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Assets/ThirdParty/Behavior Designer/Runtime/Basic Tasks/GameObject/SetTag.cs b/Assets/ThirdParty/Behavior Designer/Runtime/Basic Tasks/GameObject/SetTag.cs new file mode 100644 index 00000000..d12ab6e4 --- /dev/null +++ b/Assets/ThirdParty/Behavior Designer/Runtime/Basic Tasks/GameObject/SetTag.cs @@ -0,0 +1,27 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityGameObject +{ + [TaskCategory("Basic/GameObject")] + [TaskDescription("Sets the GameObject tag. Returns Success.")] + public class SetTag : Action + { + [Tooltip("The GameObject that the task operates on. If null the task GameObject is used.")] + public SharedGameObject targetGameObject; + [Tooltip("The GameObject tag")] + public SharedString tag; + + public override TaskStatus OnUpdate() + { + GetDefaultGameObject(targetGameObject.Value).tag = tag.Value; + + return TaskStatus.Success; + } + + public override void OnReset() + { + targetGameObject = null; + tag = ""; + } + } +} \ No newline at end of file diff --git a/Assets/ThirdParty/Behavior Designer/Runtime/Basic Tasks/GameObject/SetTag.cs.meta b/Assets/ThirdParty/Behavior Designer/Runtime/Basic Tasks/GameObject/SetTag.cs.meta new file mode 100644 index 00000000..6293b8dc --- /dev/null +++ b/Assets/ThirdParty/Behavior Designer/Runtime/Basic Tasks/GameObject/SetTag.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: e275477e6962d9b4fb90d7930bb6ff5a +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: -- cgit v1.1-26-g67d0