public void ClickToMain() { RoleData.mainRole = null; MainUI.HideAll(); MainUI.ShowUI("LoginMenu"); UnityEngine.SceneManagement.SceneManager.LoadScene("login"); }
public void Enter(GameStateBase owner) { GameObject prefab = Resources.Load("MainUICanvas") as GameObject; GameObject go = GameObject.Instantiate(prefab); uiCtr = go.GetComponent <MainUI> (); uiCtr.HideAll(); }
public static void NewGame(RoleData roleData) { MainUI.HideAll(); progress = 0; string game_path = Tools.SavePath("game.data"); int save_id = GameData.instance.save_id; GameData.instance = new GameData(); GameData.instance.NewGame(save_id); roleData.UpdateAttr(); GameData.instance.SaveGame(); byte[] byt2 = Tools.SerializeObject(GameData.instance); Tools.WriteAllBytes(game_path, byt2); progress = 50; string main_role_path = Tools.SavePath("main_role.data"); roleData.SaveGame(); byte[] byt = Tools.SerializeObject(roleData); Tools.WriteAllBytes(main_role_path, byt); QuickSave save = new QuickSave() { time = GameData.instance.GetGameData(GlobalAttribute.time), name = roleData.name, level = roleData.GetAttr(RoleAttribute.level), sex = roleData.sex, }; string quick_save_path = Tools.SavePath("quick_save.data"); byte[] byt3 = Tools.SerializeObject(save); Tools.WriteAllBytes(quick_save_path, byt3); progress = 100; SaveData.ReadGame(save_id); }
public static void ReadGame(int save_id) { MainUI.HideAll(); MainUI.instance.StartCoroutine(instance.EnterGame(save_id)); }