//===================================================== private static IEnumerator GoToNewScene(string target) { // Save player data to the server UploadPlayerDataToServer(); // Update high population score if (AchievementsManager.m_Instance != null) { AchievementsManager.m_Instance.ReportScore(GameDataManager.Instance.PlayerData.HighestEverPopulation); } // Update achievements GameDataManager.Instance.UpdateAchievements(); yield return(new WaitForSeconds(0.25f)); if (string.IsNullOrEmpty(target) == false) { PlayerPrefsWrapper.SetString("LoadingScreenScene", target); Application.LoadLevel("LoadingScreen"); } else { Debug.LogError("GameManager->OnCutsceneCompleteEvent: " + target + " location not recognised"); } }
/// <summary> /// Stores a String Array or Multiple Parameters into a Key w/ specific char seperator /// </summary> public static bool SetStringArray(string key, char separator, params string[] stringArray) { if (stringArray.Length == 0) { return(false); } try { PlayerPrefsWrapper.SetString(key, String.Join(separator.ToString(), stringArray)); } catch (Exception e) { return(false); } return(true); }
#pragma warning disable 0168 /// <summary> /// Stores a Bool Array or Multiple Parameters into a Key /// </summary> public static bool SetBoolArray(string key, params bool[] boolArray) { if (boolArray.Length == 0) { return(false); } System.Text.StringBuilder sb = new System.Text.StringBuilder(); for (int i = 0; i < boolArray.Length - 1; i++) { sb.Append(boolArray[i]).Append("|"); } sb.Append(boolArray[boolArray.Length - 1]); try { PlayerPrefsWrapper.SetString(key, sb.ToString()); } catch (Exception e) { return(false); } return(true); }
/// <summary> /// Save String value To PlayerPrefs /// </summary> /// <param name="key">Key.</param> /// <param name="value">Value.</param> public static void SetString(string key, string value) { PlayerPrefsWrapper.SetString(key, value); }