예제 #1
0
        IEnumerator AddPlayerDelayed(INetworkPlayer player)
        {
            yield return(new WaitForSeconds(.5f));

            ServerObjectManager.NetworkSceneManager.ServerLoadSceneAdditively(gameScene, Server.Players);

            PlayerScore playerScore = player.Identity.GetComponent <PlayerScore>();

            playerScore.playerNumber = playerId;
            playerScore.scoreIndex   = playerId / subScenes.Count;
            playerScore.matchIndex   = playerId % subScenes.Count;

            if (subScenes.Count > 0)
            {
                UnityEngine.SceneManagement.SceneManager.MoveGameObjectToScene(player.Identity.gameObject, subScenes[playerId % subScenes.Count]);
            }

            playerId++;
        }
예제 #2
0
        IEnumerator AddPlayerDelayed(INetworkConnection conn)
        {
            yield return(new WaitForSeconds(.5f));

            conn.Send(new SceneMessage {
                scenePath = gameScene, sceneOperation = SceneOperation.LoadAdditive
            });

            PlayerScore playerScore = conn.Identity.GetComponent <PlayerScore>();

            playerScore.playerNumber = playerId;
            playerScore.scoreIndex   = playerId / subScenes.Count;
            playerScore.matchIndex   = playerId % subScenes.Count;

            if (subScenes.Count > 0)
            {
                UnityEngine.SceneManagement.SceneManager.MoveGameObjectToScene(conn.Identity.gameObject, subScenes[playerId % subScenes.Count]);
            }

            playerId++;
        }