diff options
Diffstat (limited to 'Client/Assets/Behavior Designer/Runtime/Basic Tasks/String/IsNullOrEmpty.cs')
-rw-r--r-- | Client/Assets/Behavior Designer/Runtime/Basic Tasks/String/IsNullOrEmpty.cs | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/String/IsNullOrEmpty.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/String/IsNullOrEmpty.cs new file mode 100644 index 00000000..b61c8eb1 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/String/IsNullOrEmpty.cs @@ -0,0 +1,22 @@ +using UnityEngine;
+
+namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityString
+{
+ [TaskCategory("Basic/String")]
+ [TaskDescription("Returns success if the string is null or empty")]
+ public class IsNullOrEmpty : Conditional
+ {
+ [Tooltip("The target string")]
+ public SharedString targetString;
+
+ public override TaskStatus OnUpdate()
+ {
+ return string.IsNullOrEmpty(targetString.Value) ? TaskStatus.Success : TaskStatus.Failure;
+ }
+
+ public override void OnReset()
+ {
+ targetString = "";
+ }
+ }
+}
\ No newline at end of file |