Beispiel #1
0
    /// <summary>
    /// Updates the currentActionListNames with visualization actions names given
    /// </summary>
    /// <param name="actionNamesArray"></param>
    public void UpdateVisualizationActionNames(string[] actionNamesArray)
    {
        string Scope = ProfileManager.Instance.currentEvaluationScope;

        currentVisualizationActionsNames = new string[actionNamesArray.Length];
        actionNamesArray.CopyTo(currentVisualizationActionsNames, 0);
        GLPlayerPrefs.SetStringArray(Scope, "CurrentVisualizationActionsNames", actionNamesArray);
        ReloadMappingActionsNames();
    }
Beispiel #2
0
    /// <summary>
    /// Overload to add strings in between the interface and input name and input name and action.
    /// </summary>
    /// <param name="interfaceName"></param>
    /// <param name="inputActionsNames"></param>
    /// <returns></returns>
    public string[] GetMappedActionsListNames(string interfaceName, string[] inputActionsNames, string beforeInputName, string afterInputName)
    {
        string[] result = new string[inputActionsNames.Length];
        string   aux;

        for (int i = 0; i < inputActionsNames.Length; i++)
        {
            aux       = currentActionListNames[GetMappedActionIndex(interfaceName, inputActionsNames[i])];
            result[i] = "[·]" + interfaceName + " " + beforeInputName + " " + inputActionsNames[i] + " " + afterInputName + " as " + aux;
        }
        string Scope = ProfileManager.Instance.currentEvaluationScope;

        GLPlayerPrefs.SetStringArray(Scope, interfaceName + "SummaryActions", result);
        return(result);
    }
Beispiel #3
0
 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;
         }
     }
 }
Beispiel #4
0
 public bool AddNewEvaluation(string newEvaluation)
 {
     if (CheckRepeatedEvaluationName(newEvaluation))
     {
         string[] aux = new string[evaluations.Length];
         evaluations.CopyTo(aux, 0);
         int newLength = evaluations.Length + 1;
         evaluations = new string[newLength];
         aux.CopyTo(evaluations, 0);
         evaluations[newLength - 1] = newEvaluation;
         GLPlayerPrefs.SetStringArray(profileScope, "EvaluationNamesList", evaluations);
         UpdateCurrentEvaluation(newLength - 1);
         SetEvaluationDefaultValues();
         return(true);
     }
     else
     {
         return(false);
     }
 }
Beispiel #5
0
 public bool AddNewProfile(string newProfile)
 {
     if (CheckRepeatedProfileName(newProfile))
     {
         string[] aux = new string[profiles.Length];
         profiles.CopyTo(aux, 0);
         int newLength = profiles.Length + 1;
         profiles = new string[newLength];
         aux.CopyTo(profiles, 0);
         profiles[newLength - 1] = newProfile;
         GLPlayerPrefs.SetStringArray(profileManagerScope, "ProfileNamesList", profiles);
         aux    = new string[1];
         aux[0] = "Default Evaluation";
         GLPlayerPrefs.SetStringArray(newProfile, "EvaluationNamesList", aux);
         UpdateCurrentProfile(newLength - 1);
         return(true);
     }
     else
     {
         return(false);
     }
 }
Beispiel #6
0
 // 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();
 }