コード例 #1
0
        private IEnumerator CoroGameOver(float wait, bool gameWon)
        {
            // wait 5 seconds for game animations to finish
            yield return(new WaitForSeconds(wait));

            GameStateRelay.SetRelayObject(gameWon);
            MLAPI.SceneManagement.NetworkSceneManager.SwitchScene("PostGame");
        }
コード例 #2
0
        private void SaveLobbyResults()
        {
            LobbyResults lobbyResults = new LobbyResults();

            foreach (CharSelectData.LobbyPlayerState playerInfo in CharSelectData.LobbyPlayers)
            {
                lobbyResults.Choices[playerInfo.ClientId] = new LobbyResults.CharSelectChoice(playerInfo.PlayerNum,
                                                                                              CharSelectData.LobbySeatConfigurations[playerInfo.SeatIdx].Class,
                                                                                              CharSelectData.LobbySeatConfigurations[playerInfo.SeatIdx].CharacterArtIdx);
            }
            GameStateRelay.SetRelayObject(lobbyResults);
        }
コード例 #3
0
 /// <summary>
 /// Temp code to spawn an enemy
 /// </summary>
 private void Update()
 {
     if (Input.GetKeyDown(KeyCode.E))
     {
         var newEnemy = Instantiate(m_EnemyPrefab);
         newEnemy.SpawnWithOwnership(NetworkManager.Singleton.LocalClientId);
     }
     if (Input.GetKeyDown(KeyCode.B))
     {
         var newEnemy = Instantiate(m_BossPrefab);
         newEnemy.SpawnWithOwnership(NetworkManager.Singleton.LocalClientId);
     }
     if (Input.GetKeyDown(KeyCode.Q))
     {
         GameStateRelay.SetRelayObject(false);
         MLAPI.SceneManagement.NetworkSceneManager.SwitchScene("PostGame");
     }
 }