예제 #1
0
 public static NetClient GetGameSocket()
 {
     if (socket == null)
     {
         NetClient.PingDelegate pingDelegate = new NetClient.PingDelegate(PingGameServer);
         socket = NetClient.NewInstance("_GameSocket", pingDelegate, 20000);
     }
     return(socket);
 }
예제 #2
0
 public static NetClient GetGatewaySocket()
 {
     if (gatewaySocket == null)
     {
         NetClient.PingDelegate pingDelegate = new NetClient.PingDelegate(PingGateway);
         gatewaySocket = NetClient.NewInstance("_GameWaySocket", PingGateway, 20000);
     }
     return(gatewaySocket);
 }
예제 #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;
        }