public Dictionary <Utils.TypeOfSentence, bool> LoadAllowedTypesOfSentences() { Dictionary <Utils.TypeOfSentence, bool> typesOfSentencesToReturn = new Dictionary <Utils.TypeOfSentence, bool>(); string typesOfSentencesSaved = PlayerPrefs.GetString(Utils.allowedTypesOfSentencesSavename, null); if (string.IsNullOrEmpty(typesOfSentencesSaved)) { foreach (Utils.TypeOfSentence type in Enum.GetValues(typeof(Utils.TypeOfSentence))) { typesOfSentencesToReturn.Add(type, true); } } else { foreach (Utils.TypeOfSentence type in Enum.GetValues(typeof(Utils.TypeOfSentence))) { typesOfSentencesToReturn.Add(type, false); } string[] typesOfSentencesSeparated = Utils.getStringSeparated(typesOfSentencesSaved); foreach (string typeString in typesOfSentencesSeparated) { Utils.TypeOfSentence typeOfSentence = Utils.ParseEnum <Utils.TypeOfSentence>(typeString); typesOfSentencesToReturn[typeOfSentence] = true; } } return(typesOfSentencesToReturn); }
public void setStateOfTypeOfSentence(Utils.TypeOfSentence typeOfSentence, bool state, bool save) { this.allowedTypesOfSentences[typeOfSentence] = state; if (save) { SavesManager.instance.SaveAllowedTypesOfSentences(this.allowedTypesOfSentences); } }
public void configureButton(Utils.TypeOfSentence typeOfSentence) { this.typeOfSentence = typeOfSentence; typeOfSentenceText.GetComponent <Localizer>().configure(Utils.GetTypeOfSentenceStringOf(typeOfSentence), Localizer.ComponentToLocalize.TextMeshPro, true, true); }