DeleteKey.cs 555 B

123456789101112131415161718192021222324
  1. using UnityEngine;
  2. namespace BehaviorDesigner.Runtime.Tasks.Unity.UnityPlayerPrefs
  3. {
  4. [TaskCategory("Unity/PlayerPrefs")]
  5. [TaskDescription("Deletes the specified key from the PlayerPrefs.")]
  6. public class DeleteKey : Action
  7. {
  8. [Tooltip("The key to delete")]
  9. public SharedString key;
  10. public override TaskStatus OnUpdate()
  11. {
  12. PlayerPrefs.DeleteKey(key.Value);
  13. return TaskStatus.Success;
  14. }
  15. public override void OnReset()
  16. {
  17. key = "";
  18. }
  19. }
  20. }