public override void OnSceneLoaded(Scene scene, LoadSceneMode loadMode) { base.OnSceneLoaded(scene, loadMode); Debug.Log("大厅场景加载完成"); if (lobbyView == null) { lobbyView = new LobbyView(); lobbyView.Show(); GamePublisher.Publish(EventType.lobby_music_open); } }
public void ChangeWindow() { MusicEngine.ButtonSoundEffect(); MusicEngine.StartStop(); var window = Application.Current.Windows.OfType <Window>().SingleOrDefault(w => w.IsActive); LobbyView lobbyView = new LobbyView(); lobbyView.Show(); window.Close(); }
void Start() { _lobby.Show(); _gameOver.Hide(); _lobby.OnPlay += () => { _lobby.Hide(); StartGame(); }; _gameOver.OnLobby += () => { EndGame(); _gameOver.Hide(); _lobby.Show(); }; _gameOver.OnRestart += () => { _gameOver.Hide(); StartGame(); }; }