Beispiel #1
0
 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);
     }
 }
Beispiel #2
0
        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();
        }
Beispiel #3
0
    void Start()
    {
        _lobby.Show();
        _gameOver.Hide();

        _lobby.OnPlay += () =>
        {
            _lobby.Hide();
            StartGame();
        };

        _gameOver.OnLobby += () =>
        {
            EndGame();
            _gameOver.Hide();
            _lobby.Show();
        };

        _gameOver.OnRestart += () =>
        {
            _gameOver.Hide();
            StartGame();
        };
    }