diff options
Diffstat (limited to 'Client/Assets/Behavior Designer/Runtime/Basic Tasks/PlayerPrefs/HasKey.cs')
| -rw-r--r-- | Client/Assets/Behavior Designer/Runtime/Basic Tasks/PlayerPrefs/HasKey.cs | 22 | 
1 files changed, 22 insertions, 0 deletions
diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/PlayerPrefs/HasKey.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/PlayerPrefs/HasKey.cs new file mode 100644 index 00000000..2983fc05 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/PlayerPrefs/HasKey.cs @@ -0,0 +1,22 @@ +using UnityEngine;
 +
 +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityPlayerPrefs
 +{
 +    [TaskCategory("Basic/PlayerPrefs")]
 +    [TaskDescription("Retruns success if the specified key exists.")]
 +    public class HasKey : Conditional
 +    {
 +        [Tooltip("The key to check")]
 +        public SharedString key;
 +
 +        public override TaskStatus OnUpdate()
 +        {
 +            return PlayerPrefs.HasKey(key.Value) ? TaskStatus.Success : TaskStatus.Failure;
 +        }
 +
 +        public override void OnReset()
 +        {
 +            key = "";
 +        }
 +    }
 +}
\ No newline at end of file  | 
