diff options
Diffstat (limited to 'Client/Assets/Behavior Designer/Runtime/Basic Tasks/GameObject/Find.cs')
-rw-r--r-- | Client/Assets/Behavior Designer/Runtime/Basic Tasks/GameObject/Find.cs | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/GameObject/Find.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/GameObject/Find.cs new file mode 100644 index 00000000..067adeed --- /dev/null +++ b/Client/Assets/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 |