/// <summary> /// Returns a Bool Array from a key /// </summary> public static string[] GetStringArray(string key) { if (PlayerPrefsWrapper.HasKey(key)) { return(PlayerPrefsWrapper.GetString(key).Split("\n"[0])); } return(new string[0]); }
/// <summary> /// Returns a String Array from a key & char seperator /// </summary> public static string[] GetStringArray(string key, char separator) { if (PlayerPrefsWrapper.HasKey(key)) { return(PlayerPrefsWrapper.GetString(key).Split(separator)); } return(new string[0]); }
/// <summary> /// Returns a String Array from a key & char seperator /// Note: Uses default values to initialize if no key was found /// </summary> public static string[] GetStringArray(string key, char separator, string defaultValue, int defaultSize) { if (PlayerPrefsWrapper.HasKey(key)) { return(PlayerPrefsWrapper.GetString(key).Split(separator)); } string[] stringArray = new string[defaultSize]; for (int i = 0; i < defaultSize; i++) { stringArray[i] = defaultValue; } return(stringArray); }
/// <summary> /// Returns a Bool Array from a Key /// </summary> public static bool[] GetBoolArray(string key) { if (PlayerPrefsWrapper.HasKey(key)) { string[] stringArray = PlayerPrefsWrapper.GetString(key).Split("|"[0]); bool[] boolArray = new bool[stringArray.Length]; for (int i = 0; i < stringArray.Length; i++) { boolArray[i] = Convert.ToBoolean(stringArray[i]); } return(boolArray); } return(new bool[0]); }
/// <summary> /// Returns a Float Array from a Key /// </summary> public static float[] GetFloatArray(string key) { if (PlayerPrefsWrapper.HasKey(key)) { string[] stringArray = PlayerPrefsWrapper.GetString(key).Split("|"[0]); float[] floatArray = new float[stringArray.Length]; for (int i = 0; i < stringArray.Length; i++) { floatArray[i] = Convert.ToSingle(stringArray[i]); } return(floatArray); } return(new float[0]); }
/// <summary> /// Returns a Int Array from a Key /// </summary> public static int[] GetIntArray(string key) { if (PlayerPrefsWrapper.HasKey(key)) { string[] stringArray = PlayerPrefsWrapper.GetString(key).Split("|"[0]); int[] intArray = new int[stringArray.Length]; for (int i = 0; i < stringArray.Length; i++) { intArray[i] = Convert.ToInt32(stringArray[i]); } return(intArray); } return(new int[0]); }
/// <summary> /// Get string Value From PlayerPrefs /// </summary> /// <returns>The string.</returns> /// <param name="key">Key.</param> public static string GetString(string key) { return(PlayerPrefsWrapper.GetString(key)); }
//===================================================== void Start() { m_Stage = 0; m_Timer = 0.0f; m_LoadingScene = PlayerPrefsWrapper.GetString("LoadingScreenScene", "CommonRoom"); }