blob: 2983fc0516edad095b65470f8ef2571d741dc756 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
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 = "";
}
}
}
|