protected virtual void Awake() { logger.LogLevel = logLevel; masterServer = masterServer ?? FindObjectOfType <MasterServerBehaviour>(); networkManager = networkManager ?? FindObjectOfType <BaseNetworkGameManager>(); var connection = GetConnection(); // Listen to the connected event connection.AddConnectionListener(OnConnectedToMaster, true); if (warnIfNoConnectionObject && FindObjectOfType <ConnectionToMaster>() == null) { logger.Warn("No connection object was found in the scene. Ignore the warning, if you're connecting " + "to server manually."); } // Listen to when a room is registered Msf.Server.Rooms.RoomRegistered += OnRoomRegistered; }
private void Awake() { MasterServer = MasterServer ?? FindObjectOfType <MasterServerBehaviour>(); Spawner = Spawner ?? FindObjectOfType <SpawnerBehaviour>(); }
void Awake() { MasterServer = MasterServer ?? FindObjectOfType <MasterServerBehaviour>(); }