You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
25 lines
601 B
C#
25 lines
601 B
C#
using UnityEngine;
|
|
public static class SafePlayerPrefs
|
|
{
|
|
public static void SetInt(string key, int value)
|
|
{
|
|
PlayerPrefs.SetInt(key, value);
|
|
PlayerPrefsKeys.RegisterKey(key);
|
|
PlayerPrefs.Save();
|
|
}
|
|
|
|
public static void SetFloat(string key, float value)
|
|
{
|
|
PlayerPrefs.SetFloat(key, value);
|
|
PlayerPrefsKeys.RegisterKey(key);
|
|
PlayerPrefs.Save();
|
|
}
|
|
|
|
public static void SetString(string key, string value)
|
|
{
|
|
PlayerPrefs.SetString(key, value);
|
|
PlayerPrefsKeys.RegisterKey(key);
|
|
PlayerPrefs.Save();
|
|
}
|
|
}
|