Files
beyond/Assets/ThirdParty/PlayMaker/Actions/PlayerPrefs/PlayerPrefsDeleteKey.cs
2024-11-20 15:21:28 +01:00

34 lines
661 B
C#

// (c) Copyright HutongGames, LLC 2010-2013. All rights reserved.
using UnityEngine;
namespace HutongGames.PlayMaker.Actions
{
[ActionCategory("PlayerPrefs")]
[Tooltip("Removes key and its corresponding value from the preferences.")]
public class PlayerPrefsDeleteKey : FsmStateAction
{
public FsmString key;
public override void Reset()
{
key = "";
}
public override void OnEnter()
{
if(!key.IsNone && !key.Value.Equals("")) PlayerPrefs.DeleteKey(key.Value);
Finish();
}
#if UNITY_EDITOR
public override string AutoName()
{
return ActionHelpers.AutoName("PlayerPrefsDelete", key);
}
#endif
}
}