public void CreateNewSaveFile() { if (newFileName.Equals("")) { return; } KeyBoard.SetActive(false); SaveFilePath saveFilePath = new SaveFilePath(newFileName, extension); SaveGameManager.SaveGame(CreateSaveGameObject(), saveFilePath.FilePath); GameObject newButton = Instantiate(ListButtonPrecurser) as GameObject; newButton.GetComponentInChildren <Text>().text = newFileName + extension; newButton.transform.SetParent(ButtonListContent.transform, false); newButton.GetComponent <Button>().onClick.AddListener(() => SetCurrentFile(saveFilePath)); SetCurrentFile(saveFilePath); EnableButtons(); }
public void SetCurrentFile(SaveFilePath saveFilePath) { CurrentlyChoosenFile = saveFilePath; }