public void FixedUpdate() { try { string nameButton = EventSystem.current.currentSelectedGameObject.name; if (nameButton.Contains("save")) { var nameOfSave = nameButton.Substring(4); if (!SaveSerializable.UniquiSaveName(nameOfSave)) { SaveSerializable.LoadGame(nameOfSave); nameButton = null; } } } catch { } if (Input.GetAxis("Cancel") != 0) { Transition.TransitionAnimationFrom(); var sceneManager = new GameObject(); var manager = sceneManager.AddComponent <MySceneManager>(); manager.LoadSceneByNumber(1); } }
public void CreatGame() { if (SaveSerializable.UniquiSaveName(NewGameName.text)) { SavePlayerData.NameOfSave = NewGameName.text; SavePlayerData.CoordinateOnScene = new Vector3(0, 0, 0); SavePlayerData.LocationID = 2; SavePlayerData.StoryTrigger = 0; SavePlayerData.OtherCaracteristics = new Dictionary <float, string>(); NewGameName.text = null; } else { StartCoroutine(AllertController.ShowAllert(allertText, "Not unigue name")); } }