public void AddItem(string character, string stat) { CleanList(); ContentItem newItem = CreateItem(character, stat); saving.saveFile.data.Add(newItem.characterText.text, Convert.ToInt32(newItem.statText.text)); saving.Save(); SortList(); }
public int scene; // индекс загружаемой сцены по умолчанию, который в редакторе можно изменить void Update() { if (Input.GetKey(KeyCode.V)) { SceneManager.LoadScene(scene); Saving.level++; Saving.Save(); } }
public void Save() { if (path != null) { GamesLogs _logs; Saving.TryLoad(path, out _logs); _logs.AddGame(currentGameLogs); Saving.Save(path, _logs); } }
private void StartNewTest() { if (Input.GetKeyDown(KeyCode.RightControl)) { save.Save("newTest"); save.Save("choosenAngle" + "\t" + "testedAngle" + "\t"); angles = ran.los(angle1, testNumber, angles); testCouter = 0; isNewAngleAllowed = true; isBackToZeroRotationNeeded = true; step = 0; } }
public static void Save() { Saving.Save(pathGestures, Data); Saving.Save(pathClasses, classesMap); Data.toCSV(); }
public int scene; // индекс загружаемой сцены по умолчанию, который в редакторе можно изменить void Start() { Saving.Save(); }
private void setRecordText(int number) { record = number; recordText.text = infoRecordText + record.ToString(); gameSaves.Save(record); }
public void SetTheme(int theme) { chosenTheme = theme; sprite = availableThemes[chosenTheme].sprite; light = availableThemes[chosenTheme].light; medium = availableThemes[chosenTheme].medium; heavy = availableThemes[chosenTheme].heavy; textColor = availableThemes[chosenTheme].textColor; extreme = availableThemes[chosenTheme].extreme; for (int i = 0; i < text.Count; i++) { if (text[i] == null) { text.RemoveAt(i); i--; } else { text[i].color = textColor; } } for (int i = 0; i < images.Count; i++) { if (images[i] == null) { images.RemoveAt(i); i--; } else { images[i].sprite = sprite; images[i].color = light; } } for (int i = 0; i < heavyImages.Count; i++) { if (heavyImages[i] == null) { heavyImages.RemoveAt(i); i--; } else { heavyImages[i].sprite = sprite; heavyImages[i].color = heavy; } } for (int i = 0; i < extremeImages.Count; i++) { if (extremeImages[i] == null) { extremeImages.RemoveAt(i); i--; } else { extremeImages[i].sprite = sprite; extremeImages[i].color = extreme; } } for (int i = 0; i < buttons.Count; i++) { if (buttons[i] == null) { buttons.RemoveAt(i); i--; } else { ColorBlock cb = buttons[i].colors; cb.normalColor = medium; cb.highlightedColor = heavy; cb.pressedColor = extreme; cb.disabledColor = heavy; buttons[i].colors = cb; } } for (int i = 0; i < scrollbars.Count; i++) { if (scrollbars[i] == null) { scrollbars.RemoveAt(i); i--; } else { ColorBlock cb = scrollbars[i].colors; cb.normalColor = light; cb.highlightedColor = medium; cb.pressedColor = heavy; cb.disabledColor = heavy; scrollbars[i].colors = cb; } } for (int i = 0; i < inputFields.Count; i++) { if (inputFields[i] == null) { inputFields.RemoveAt(i); i--; } else { ColorBlock cb = inputFields[i].colors; cb.normalColor = blank; cb.highlightedColor = medium; cb.pressedColor = heavy; cb.disabledColor = heavy; inputFields[i].colors = cb; } } saving.saveFile.theme = chosenTheme; saving.Save(); }
public void Accept() { if (characterText.text != "" && statText.text != "") { if (editing) { if (characterText.text == editCharacter.text) { saving.saveFile.data[editCharacter.text] = Convert.ToInt32(statText.text); editCharacter.text = characterText.text; editStat.text = statText.text; gameObject.SetActive(false); error.text = ""; saving.Save(); listContent.SortList(); } else { bool found = false; foreach (KeyValuePair <string, int> entry in saving.saveFile.data) { if (entry.Key == characterText.text) { found = true; } } if (!found) { saving.saveFile.data.Remove(editCharacter.text); saving.saveFile.data.Add(characterText.text, Convert.ToInt32(statText.text)); saving.Save(); editCharacter.text = characterText.text; editStat.text = statText.text; gameObject.SetActive(false); error.text = ""; saving.Save(); listContent.SortList(); } else { error.text = "A character with that name already exists!"; } } } else { bool found = false; foreach (KeyValuePair <string, int> entry in saving.saveFile.data) { if (entry.Key == characterText.text) { found = true; } } if (!found) { listContent.AddItem(characterText.text, statText.text); gameObject.SetActive(false); error.text = ""; } else { error.text = "A character with that name already exists!"; } } } else { error.text = "Please fill out both fields!"; } }
public void DeleteSelf() { saving.saveFile.data.Remove(characterText.text); saving.Save(); Destroy(gameObject); }
public void ZapiszDane() { Saving.FileName = path.text; zapis.Save(imie.text + "\t" + wiek.text + "\r\n"); TextureSwapper.Color = "czarny" + "\t" + "biały"; }