IEnumerator PlayerRotation() { LobbyNetworkManager lobbyManager = NetworkManager.singleton as LobbyNetworkManager; while (playersParent.childCount != lobbyManager.GetNumPlayers()) { Debug.Log("[GameManager] Waiting for players..."); yield return(new WaitForSeconds(1)); } PlayerController currentPlayer; while (true) { Debug.Log("[GameManager] Player with " + playersParent.childCount + " players"); for (int playerIndex = 0; playerIndex < playersParent.childCount; playerIndex++) { //set up next player currentPlayer = playersParent.GetChild(playerIndex).GetComponent <PlayerController>(); currentPlayerName = currentPlayer.DisplayName; currentPlayerDisplayName.text = currentPlayerName; yield return(StartCoroutine(StartCountDown())); currentPlayer.SetCurrentPlayer(true); yield return(StartCoroutine(PlayerTurnCountdown())); currentPlayer.SetCurrentPlayer(false); } } }
public override void OnStartServer() { Debug.Log("[SpawnManager] SpawnManager: active on server "); LobbyNetworkManager networkManager = LobbyNetworkManager.singleton as LobbyNetworkManager; LobbyNetworkManager.OnServerReadied += SpawnPlayer; }
void Start() { //This will run when the game starts, so put this here to prevent devices to go to sleep mode Screen.sleepTimeout = SleepTimeout.NeverSleep; connectionConfig.NetworkDropThreshold = 90; networkEventReceiver = networkEventReceiverObject.GetComponent <INetworkEventReceiver>(); s_Singleton = this; _lobbyHooks = GetComponent <LobbyHook>(); GetComponent <Canvas>().enabled = true; DontDestroyOnLoad(gameObject); }
void Start() { networkManager = GetComponent <LobbyNetworkManager>(); if (!SteamManager.Initialized) { menuManager.NavigateToMenu("Error", "The game needs to be launched through Steam!"); return; } lobbyCreated = Callback <LobbyCreated_t> .Create(OnLobbyCreated); gameLobbyJoinRequested = Callback <GameLobbyJoinRequested_t> .Create(OnGameLobbyJoinRequested); lobbyEntered = Callback <LobbyEnter_t> .Create(OnLobbyEntered); }
void Start() { networkManager = FindObjectOfType <LobbyNetworkManager>(); menuManager = FindObjectOfType <MenuManager>(); menuManager.HideLoading(); }
void Awake() { instance = this; }
// Start is called before the first frame update void Start() { m_enteredCode = ""; m_lobbyNetworkManager = this.GetComponent <LobbyNetworkManager>(); }