示例#1
0
 // Start is called before the first frame update
 void Start()
 {
     ClickRayLayer = 1 << (LayerMask.GetMask(ClickRayLayerName));
     RotateSpeed   = (float)Convert.ToDouble(XmlReadAndWrite.LoadXml("ModleClickandRotates", "RotateSpeed"));
     ScaleSpeed    = (float)Convert.ToDouble(XmlReadAndWrite.LoadXml("ModleClickandRotates", "ScaleSpeed"));
     ScaleLimitMin = (float)Convert.ToDouble(XmlReadAndWrite.LoadXml("ModleClickandRotates", "ScaleLimitMin"));
     ScaleLimitMax = (float)Convert.ToDouble(XmlReadAndWrite.LoadXml("ModleClickandRotates", "ScaleLimitMax"));
     ScaleLimitMin = ScaleLimitMin * transform.localScale.x;
     ScaleLimitMax = ScaleLimitMax * transform.localScale.y;
 }
示例#2
0
 // Start is called before the first frame update
 void Start()
 {
     IP   = XmlReadAndWrite.LoadXml("TCPServer", "IP");
     Port = Convert.ToInt32(XmlReadAndWrite.LoadXml("TCPServer", "Port"));
     _Tcp = new TcpConnection(new HXPackage());
     _Tcp.OnConnecting += OnConnecting;
     _Tcp.OnConnected  += OnConnected;
     _Tcp.OnReceive    += OnReceive;
     _Tcp.Connect(new IPEndPoint(IPAddress.Parse(IP), Port));
 }
示例#3
0
 // Start is called before the first frame update
 void Start()
 {
     IP   = XmlReadAndWrite.LoadXml("TCPServer", "IP");
     Port = Convert.ToInt32(XmlReadAndWrite.LoadXml("TCPServer", "Port"));
     ConnectionRequestCount = Convert.ToInt32(XmlReadAndWrite.LoadXml("TCPServer", "ConnectionRequestCount"));
     ServerSocket           = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
     ServerSocket.SetSocketOption(SocketOptionLevel.Socket, SocketOptionName.ReuseAddress, true);
     ServerSocket.Bind(new IPEndPoint(IPAddress.Parse(IP), Port));
     ServerSocket.Listen(ConnectionRequestCount);
     ServerSocket.NoDelay = true;
     ConnectThread        = new Thread(SocketConnet);
     ConnectThread.Start();
 }