Exemple #1
0
    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;
    }
Exemple #2
0
 private void Awake()
 {
     MasterServer = MasterServer ?? FindObjectOfType <MasterServerBehaviour>();
     Spawner      = Spawner ?? FindObjectOfType <SpawnerBehaviour>();
 }
Exemple #3
0
 void Awake()
 {
     MasterServer = MasterServer ?? FindObjectOfType <MasterServerBehaviour>();
 }