IEnumerator _Room() { yield return(SceneSystem.LoadScene(GameScene.room)); onGameReady?.Invoke(); yield return(0); ResetGameMessage(); while (true) { yield return(0); if (GetGameMessage(GameMessage.DisConnect)) { // 回到开始菜单 NetworkSystem.ShutdownServer(); StartCoroutine(_Lobby()); break; } } }
// 开始菜单 IEnumerator _StartMenu() { NetworkSystem.ShutdownClient(); yield return(SceneSystem.LoadScene(GameScene.startMenu)); yield return(0); InputSystem.ChangeState(new InputSystem.MoveState()); ResetGameMessage(); while (true) { yield return(0); if (GetGameMessage(GameMessage.Next)) { break; } } StartCoroutine(_Lobby()); }