diff options
Diffstat (limited to 'Client/Assets/Behavior Designer/Runtime/Basic Tasks/LayerMask/GetLayer.cs')
-rw-r--r-- | Client/Assets/Behavior Designer/Runtime/Basic Tasks/LayerMask/GetLayer.cs | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/LayerMask/GetLayer.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/LayerMask/GetLayer.cs new file mode 100644 index 00000000..032e47be --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/LayerMask/GetLayer.cs @@ -0,0 +1,28 @@ +using UnityEngine;
+
+namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityLayerMask
+{
+ [TaskCategory("Basic/LayerMask")]
+ [TaskDescription("Gets the layer of a GameObject.")]
+ public class GetLayer : Action
+ {
+ [Tooltip("The GameObject to set the layer of")]
+ public SharedGameObject targetGameObject;
+ [Tooltip("The name of the layer to get")]
+ [RequiredField]
+ public SharedString storeResult;
+
+ public override TaskStatus OnUpdate()
+ {
+ var currentGameObject = GetDefaultGameObject(targetGameObject.Value);
+ storeResult.Value = LayerMask.LayerToName(currentGameObject.layer);
+ return TaskStatus.Success;
+ }
+
+ public override void OnReset()
+ {
+ targetGameObject = null;
+ storeResult = "";
+ }
+ }
+}
\ No newline at end of file |