// Load the first level public void LoadGame(ObjSyncList <PlayerSelector> selectorList, float additionalTime = 0) { // Caching the selectors to be used for the players selectorList.ExecStatement(selector => playerManager.cachedSelectors.Add(selector.id, selector.index)); SceneManager.sceneLoaded += OnSceneLoaded; SceneManager.LoadScene(1, LoadSceneMode.Single); InLobby = false; }
public PeerManager(ushort listenPort, string name, bool isHost = false) { peerList = new ObjSyncList <Peer>(new Peer(0, NetworkTools.PublicIp, listenPort, name)); if (isHost) { SetHost(peerList.localInstance); } }
// Send out a signal that the game is starting public void StartGame(ObjSyncList <PlayerSelector> selectorList) { peerManager.SendDataToAllPeers(new List <byte>(), PacketType.startGame, PacketValue.changeUpdate, true); LoadGame(selectorList); }