Ejemplo n.º 1
0
 public static NetClient GetGameSocket()
 {
     if (socket == null)
     {
         NetClient.PingDelegate pingDelegate = new NetClient.PingDelegate(PingGameServer);
         socket = NetClient.NewInstance("_GameSocket", pingDelegate, 20000);
     }
     return(socket);
 }
Ejemplo n.º 2
0
 public static NetClient GetGatewaySocket()
 {
     if (gatewaySocket == null)
     {
         NetClient.PingDelegate pingDelegate = new NetClient.PingDelegate(PingGateway);
         gatewaySocket = NetClient.NewInstance("_GameWaySocket", PingGateway, 20000);
     }
     return(gatewaySocket);
 }
Ejemplo n.º 3
0
        public static NetClient NewInstance(string name, NetClient.PingDelegate pingDelegate, int pingTimeout)
        {
            GameObject go = new GameObject(name);
			go.hideFlags = HideFlags.HideAndDontSave;
            DontDestroyOnLoad(go);
            NetClient netClient = go.AddComponent<NetClient>();
            netClient.m_pingDelegate = pingDelegate;
            netClient.m_pingTimeount = pingTimeout;
            return netClient;
        }