public bool UpdateCurrentProfile(int lastProfileUsedNumber) { currentProfile = lastProfileUsedNumber; GLPlayerPrefs.SetInt(profileManagerScope, "CurrentProfile", currentProfile); profileScope = profiles[currentProfile]; currentEvaluation = GLPlayerPrefs.GetInt(profileScope, "CurrentEvaluation"); evaluations = GLPlayerPrefs.GetStringArray(profileScope, "EvaluationNamesList"); currentEvaluationScope = profileScope + evaluations[currentEvaluation]; return(true); }
/// <summary> /// Loads from the playerprefs the current object and visualization action names and asigns them to their variables /// </summary> public void LoadMappingActionsNames() { string Scope = ProfileManager.Instance.currentEvaluationScope; string[] aux = GLPlayerPrefs.GetStringArray(Scope, "CurrentInformationObjectActionsNames"); currentObjectActionsNames = new string[aux.Length]; aux.CopyTo(currentObjectActionsNames, 0); string[] aux2 = GLPlayerPrefs.GetStringArray(Scope, "CurrentVisualizationActionsNames"); currentVisualizationActionsNames = new string[aux2.Length]; aux2.CopyTo(currentVisualizationActionsNames, 0); ReloadMappingActionsNames(); }
public void ShowAllPairedActions() { string allActionsList = ""; string Scope = ProfileManager.Instance.currentEvaluationScope; foreach (string s in MOTIONSManager.Instance.interfacesWithInputNames) { if (GLPlayerPrefs.GetBool(Scope, "use" + s)) { foreach (string a in GLPlayerPrefs.GetStringArray(Scope, s + "SummaryActions")) { allActionsList = allActionsList + a + "\n"; } } } fullListScrollView.LaunchScrollDown("Mapped actions list", allActionsList); }
public void RespawnPlayerHere() { string[] checkPoints = GLPlayerPrefs.GetStringArray(scope, LAST_CHECKPOINT); if (checkPoints.Length == 0) { return; } string lastCode = checkPoints[checkPoints.Length - 1]; if (lastCode == GetCode()) { Debug.Log("Respawn player at: " + GetCode()); player.transform.position = this.transform.position + player.transform.up * 0.5f; lastCheckpoint = this; } }
public override void Execute() { if (!isChecked) { isChecked = true; string[] checkPoints = GLPlayerPrefs.GetStringArray(scope, LAST_CHECKPOINT); var exists = Array.Exists(checkPoints, x => x == GetCode()); if (!exists) { Array.Resize(ref checkPoints, checkPoints.Length + 1); checkPoints[checkPoints.Length - 1] = GetCode(); GLPlayerPrefs.SetStringArray(scope, LAST_CHECKPOINT, checkPoints); Debug.Log("Checkpoint saved: " + GetCode()); lastCheckpoint = this; } } }
// Use this for initialization public void Awake() { Instance = this; DontDestroyOnLoad(this); //If there are no profiles found in the systems registry, it creates a new array of names. This is because there is no default value for arrays, but there are for all other data types used. if (!GLPlayerPrefs.GetBool(profileManagerScope, "RegistryFound")) { string[] aux = new string[1]; aux[0] = "Default Profile"; GLPlayerPrefs.SetStringArray(profileManagerScope, "ProfileNamesList", aux); GLPlayerPrefs.SetBool(profileManagerScope, "RegistryFound", true); aux = new string[1]; aux[0] = "Default Evaluation"; GLPlayerPrefs.SetStringArray("Default Profile", "EvaluationNamesList", aux); } profiles = GLPlayerPrefs.GetStringArray(profileManagerScope, "ProfileNamesList"); currentProfile = GLPlayerPrefs.GetInt(profileManagerScope, "CurrentProfile"); profileScope = profiles[currentProfile]; currentEvaluation = GLPlayerPrefs.GetInt(profileScope, "CurrentEvaluation"); evaluations = GLPlayerPrefs.GetStringArray(profileScope, "EvaluationNamesList"); currentEvaluationScope = profileScope + evaluations[currentEvaluation]; MOTIONSManager.Instance.initializeCsv(); }