Beispiel #1
0
    void Awake()
    {
        lightMirrorTransport = GetComponent <LightReflectiveMirrorTransport>();

        if (directConnectTransport == null)
        {
            Debug.Log("Direct Connect Transport is null!");
            return;
        }

        if (directConnectTransport is LightReflectiveMirrorTransport)
        {
            Debug.Log("Direct Connect Transport Cannot be the relay, silly. :P");
            return;
        }

        directConnectTransport.OnServerConnected    = (OnServerConnected);
        directConnectTransport.OnServerDataReceived = (OnServerDataReceived);
        directConnectTransport.OnServerDisconnected = (OnServerDisconnected);
        directConnectTransport.OnServerError        = (OnServerError);
        directConnectTransport.OnClientConnected    = (OnClientConnected);
        directConnectTransport.OnClientDataReceived = (OnClientDataReceived);
        directConnectTransport.OnClientDisconnected = (OnClientDisconnected);
        directConnectTransport.OnClientError        = (OnClientError);
    }
 void Start()
 {
     if (_LRM == null)
     {
         _LRM = (LightReflectiveMirrorTransport)Transport.activeTransport;
         _LRM.serverListUpdated.AddListener(OnServerListUpdated);
     }
 }
 void Start()
 {
     _LRM = (LightReflectiveMirrorTransport)Transport.activeTransport;
     _LRM.serverListUpdated.AddListener(ServerListUpdated);
     StartCoroutine(TestLRM());
 }