/// <summary> /// 重新开始按钮 /// </summary> /// <param name="go">Go.</param> public void _OnNewplayHandler(GameObject go) { LocalDataManager.Instance.IsNormalEnded = true; Audio.AudioManager.Instance.BtnMusic(); Console.WriteLine("点击重新开始"); //暂停状态机 , 刷新人物数据信息 , 刷新人物状态 VirtualServer.Instance.ReStartGame(); Client.Unit.BattleController.Instance.ReStartGame(); PlayerManager.Instance.ReStartGame(); Client.Scenes.SceneManager.Instance.CurrentScene.RestartGame(); MessageHint.Dispose(); var effectController = UIControllerManager.Instance.GetController <UISpecialeffectsWindowController> (); effectController.ReInitConttoller(); effectController.setVisible(false); effectController = UIControllerManager.Instance.GetController <UISpecialeffectsWindowController> (); effectController.setVisible(true); var battlerController = UIControllerManager.Instance.GetController <UIBattleController> (); if (null != battlerController) { battlerController.setVisible(false); battlerController.RestartList(); } battlerController = UIControllerManager.Instance.GetController <UIBattleController> (); battlerController.setVisible(true); _controller.setVisible(false); }
/// <summary> /// 返回到游戏开始界面 /// </summary> /// <param name="go">Go.</param> private void _OnBackHandle(GameObject go) { Audio.AudioManager.Instance.BtnMusic(); if (GameModel.GetInstance.isPlayNet == true) { //var quitcontroller = UIControllerManager.Instance.GetController<UIQuitFightGameWindowController> (); NetWorkScript.getInstance().AgreeQuitGame(); _controller.setVisible(false); return; } else { MessageManager.getInstance().netExitGameDeleteCards(); } LocalDataManager.Instance.IsNormalEnded = true; VirtualServer.Instance.Dispose(); Client.Unit.BattleController.Instance.Dispose(); // Client.Room.Instance.Dispose (); MessageHint.Dispose(); var effectController = UIControllerManager.Instance.GetController <UISpecialeffectsWindowController> (); effectController.ReInitConttoller(); effectController.setVisible(false); var battlerController = UIControllerManager.Instance.GetController <UIBattleController> (); if (null != battlerController) { battlerController.setVisible(false); battlerController.RestartList(); } Client.Scenes.SceneManager.Instance.CurrentScene.Unload(); PlayerManager.Instance.Dispose(); // MBGame.Instance.OnApplicationRestart (); var controller = Client.UIControllerManager.Instance.GetController <UILoadingWindowController>(); controller.setVisible(true); //controller.LoadSeletRoleUI(); controller.LoadGameHallUI(); _controller.setVisible(false); Audio.AudioManager.Instance.Stop(); }
private void _OnBackHandler(GameObject go) { Audio.AudioManager.Instance.BtnMusic(); LocalDataManager.Instance.IsNormalEnded = true; Client.Unit.BattleController.Instance.Dispose(); VirtualServer.Instance.Dispose(); MessageHint.Dispose(); var effectController = UIControllerManager.Instance.GetController <UISpecialeffectsWindowController> (); effectController.ReInitConttoller(); effectController.setVisible(false); var battlerController = UIControllerManager.Instance.GetController <UIBattleController> (); if (null != battlerController) { battlerController.setVisible(false); battlerController.RestartList(); } Client.Scenes.SceneManager.Instance.CurrentScene.Unload(); PlayerManager.Instance.Dispose(); GameModel.GetInstance.InitNetGameBackData(); MessageManager.getInstance().netExitGameDeleteCards(); var controller = Client.UIControllerManager.Instance.GetController <UILoadingWindowController>(); controller.setVisible(true); controller.LoadGameHallUI(); // if (GameModel.GetInstance.isPlayNet==true) // { // NetWorkScript.getInstance ().RequestExitRoom (GameModel.GetInstance.myHandInfor.uuid,GameModel.GetInstance.curRoomId); // } if (null != _controller) { _controller.setVisible(false); } }