Exemplo n.º 1
0
    // Use this for initialization
    IEnumerator Start()
    {
        // Make sure we run when not focussed
#if !UNITY_WEBGL
        Application.runInBackground = true;
#endif

        // Override dev mode in production if required
        string dev = Parameters.Get("dev");
        if (!string.IsNullOrEmpty(dev))
        {
            this.development = true;
        }

        // Select config
        if (this.development)
        {
            config = configDev;
        }
        else
        {
            config = configLive;
        }

        // Connect to master server
        yield return(StartCoroutine(ConnectToMaster(config.host)));

        // Send a room message
        if (MasterServer.Connected())
        {
            // TODO This is where you should send a login
            // DEBUG Lets find some rooms
            MasterServer.ListRoomsRequest(config.region);
        }
        else
        {
            Debug.LogWarning("Not connected to master server");
        }
    }