예제 #1
0
    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);
            }
        }
    }
예제 #2
0
    public override void OnStartServer()
    {
        Debug.Log("[SpawnManager] SpawnManager: active on server ");
        LobbyNetworkManager networkManager = LobbyNetworkManager.singleton as LobbyNetworkManager;

        LobbyNetworkManager.OnServerReadied += SpawnPlayer;
    }
예제 #3
0
    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();
 }
예제 #6
0
 void Awake()
 {
     instance = this;
 }
예제 #7
0
 // Start is called before the first frame update
 void Start()
 {
     m_enteredCode         = "";
     m_lobbyNetworkManager = this.GetComponent <LobbyNetworkManager>();
 }