Exemplo n.º 1
0
        public static void Disconnect(ConnectToPlayer ctp)
        {
            var ccs = GetAllConnectors();

            foreach (var c in ccs)
            {
                c(ConnectionStatus.Disconnected, ctp);
            }
        }
 private static void Connect(ConnectionStatus status, ConnectToPlayer ctp)
 {
     if (status == ConnectionStatus.Connected)
     {
         ctp.onGUI += OnGUI;
         ctp.RegisterMessageHandler(ECMID.Inspector, OnMessageReceived);
     }
     else if (status == ConnectionStatus.Disconnected)
     {
         ctp.onGUI -= OnGUI;
         ctp.UnregisterMessageHandler(ECMID.Inspector, OnMessageReceived);
     }
 }