Esempio n. 1
0
        public override void OnClientSceneChanged(NetworkConnection conn)
        {
            Debug.Log("Scene Changed");

            base.OnClientSceneChanged(conn);

            string sceneName = SceneManager.GetActiveScene().name;

            if (sceneName == gameScene)
            {
                for (int i = 0; i < connectedPlayers.Count; i++)
                {
                    NetworkPlayer np = connectedPlayers [i];
                    np.OnEnterGameScene();
                }

                GameMenu.Instance.Init();
            }
            else if (sceneName == lobbyScene)
            {
                for (int i = 0; i < connectedPlayers.Count; i++)
                {
                    NetworkPlayer np = connectedPlayers [i];
                    np.OnEnterLobbyScene();
                }
            }
        }
Esempio n. 2
0
        public void RegisterPlayer(NetworkPlayer player)
        {
            connectedPlayers.Add(player);

            player.OnEnterLobbyScene();

            UpdatePlayerIDs();
        }