Просмотр исходного кода

新的网络库, 用socket实现,减少gc

tanghai 7 лет назад
Родитель
Сommit
8ec13716ca
37 измененных файлов с 2247 добавлено и 1940 удалено
  1. 1 1
      Config/StartConfig/Benchmark2.txt
  2. 4 0
      Proto/OuterMessage.proto
  3. 2 4
      Server/App/Program.cs
  4. 22 1
      Server/Hotfix/Handler/C2R_PingHandler.cs
  5. 14 0
      Server/Hotfix/Handler/G2C_TestHandler.cs
  6. 1 1
      Server/Hotfix/Module/Message/InnerMessageDispatcher.cs
  7. 9 0
      Server/Hotfix/Module/Message/NetInnerComponentSystem.cs
  8. 11 2
      Server/Hotfix/Module/Message/NetOuterComponentSystem.cs
  9. 6 1
      Server/Hotfix/Module/Message/OuterMessage.cs
  10. 1 1
      Server/Hotfix/Module/Message/OuterMessageDispatcher.cs
  11. 1 0
      Server/Hotfix/Module/Message/OuterOpcode.cs
  12. 46 1
      Unity/Assets/Scripts/Base/Object/ComponentFactory.cs
  13. 4 1
      Unity/Assets/Scripts/Base/OneThreadSynchronizationContext.cs
  14. 12 0
      Unity/Assets/Scripts/G2C_TestHandler.cs
  15. 13 0
      Unity/Assets/Scripts/G2C_TestHandler.cs.meta
  16. 2 4
      Unity/Assets/Scripts/Init.cs
  17. 1 1
      Unity/Assets/Scripts/Module/Message/ClientDispatcher.cs
  18. 4 2
      Unity/Assets/Scripts/Module/Message/ErrorCode.cs
  19. 10 1
      Unity/Assets/Scripts/Module/Message/NetOuterComponent.cs
  20. 14 17
      Unity/Assets/Scripts/Module/Message/Network/AChannel.cs
  21. 21 3
      Unity/Assets/Scripts/Module/Message/Network/AService.cs
  22. 34 41
      Unity/Assets/Scripts/Module/Message/Network/KCP/KChannel.cs
  23. 103 107
      Unity/Assets/Scripts/Module/Message/Network/KCP/KService.cs
  24. 1154 1179
      Unity/Assets/Scripts/Module/Message/Network/KCP/Kcp.cs
  25. 21 11
      Unity/Assets/Scripts/Module/Message/Network/TCP/PacketParser.cs
  26. 213 127
      Unity/Assets/Scripts/Module/Message/Network/TCP/TChannel.cs
  27. 67 22
      Unity/Assets/Scripts/Module/Message/Network/TCP/TService.cs
  28. 34 69
      Unity/Assets/Scripts/Module/Message/NetworkComponent.cs
  29. 6 0
      Unity/Assets/Scripts/Module/Message/OuterMessage.cs
  30. 1 0
      Unity/Assets/Scripts/Module/Message/OuterOpcode.cs
  31. 36 21
      Unity/Assets/Scripts/Module/Message/Session.cs
  32. 45 0
      Unity/Hotfix/Base/Object/ComponentFactory.cs
  33. 14 6
      Unity/Hotfix/Module/Message/Session.cs
  34. 86 86
      Unity/Unity.Editor.Plugins.csproj
  35. 86 86
      Unity/Unity.Editor.csproj
  36. 70 70
      Unity/Unity.Plugins.csproj
  37. 78 74
      Unity/Unity.csproj

+ 1 - 1
Config/StartConfig/Benchmark2.txt

@@ -1,2 +1,2 @@
-{ "_t" : "StartConfig", "_id" : NumberLong("98547768819754"), "components" : [{ "_t" : "OuterConfig", "Host" : "127.0.0.1", "Port" : 10002, "Host2" : null }, { "_t" : "InnerConfig", "Host" : "127.0.0.1", "Port" : 20000 }, { "_t" : "HttpConfig", "Url" : "", "AppId" : 0, "AppKey" : "", "ManagerSystemUrl" : "" }, { "_t" : "DBConfig", "ConnectionString" : null, "DBName" : null }], "AppId" : 1, "AppType" : "AllServer", "ServerIP" : "*" }
+{ "_t" : "StartConfig", "_id" : NumberLong("98547768819754"), "components" : [{ "_t" : "OuterConfig", "Host" : "127.0.0.1", "Port" : 10002, "Host2" : null }, { "_t" : "InnerConfig", "Host" : "127.0.0.1", "Port" : 20000 }, { "_t" : "HttpConfig", "Url" : "", "AppId" : 0, "AppKey" : "", "ManagerSystemUrl" : "" }, { "_t" : "DBConfig", "ConnectionString" : null, "DBName" : null }], "AppId" : 1, "AppType" : "Manager", "ServerIP" : "*" }
 { "_t" : "StartConfig", "_id" : NumberLong("98892711264291"), "components" : [{ "_t" : "ClientConfig", "Host" : "127.0.0.1", "Port" : 10002 }], "AppId" : 2, "AppType" : "Benchmark", "ServerIP" : "*" }

+ 4 - 0
Proto/OuterMessage.proto

@@ -65,4 +65,8 @@ message C2R_Ping // IRequest
 
 message R2C_Ping // IResponse
 {
+}
+
+message G2C_Test // IMessage
+{
 }

+ 2 - 4
Server/App/Program.cs

@@ -2,7 +2,6 @@
 using System.Net;
 using System.Threading;
 using ETModel;
-using MongoDB.Bson.Serialization;
 using NLog;
 
 namespace App
@@ -12,8 +11,7 @@ namespace App
 		private static void Main(string[] args)
 		{
 			// 异步方法全部会回掉到主线程
-			OneThreadSynchronizationContext contex = new OneThreadSynchronizationContext();
-			SynchronizationContext.SetSynchronizationContext(contex);
+			SynchronizationContext.SetSynchronizationContext(OneThreadSynchronizationContext.Instance);
 			
 			try
 			{
@@ -113,7 +111,7 @@ namespace App
 					try
 					{
 						Thread.Sleep(1);
-						contex.Update();
+						OneThreadSynchronizationContext.Instance.Update();
 						Game.EventSystem.Update();
 					}
 					catch (Exception e)

+ 22 - 1
Server/Hotfix/Handler/C2R_PingHandler.cs

@@ -3,13 +3,34 @@ using ETModel;
 
 namespace ETHotfix
 {
-	[MessageHandler(AppType.Realm)]
+	[MessageHandler(AppType.AllServer)]
 	public class C2R_PingHandler : AMRpcHandler<C2R_Ping, R2C_Ping>
 	{
+		private bool isStart = false;
 		protected override void Run(Session session, C2R_Ping message, Action<R2C_Ping> reply)
 		{
 			R2C_Ping r2CPing = new R2C_Ping();
 			reply(r2CPing);
+
+			if (!this.isStart)
+			{
+				isStart = true;
+				Start(session);
+			}
+		}
+		
+		public async void Start(Session session)
+		{
+			TimerComponent timerComponent = Game.Scene.GetComponent<TimerComponent>();
+			G2C_Test g2CTest = new G2C_Test();
+			while (true)
+			{
+				await timerComponent.WaitAsync(1);
+				for (int i = 0; i < 20; ++i)
+				{
+					session.Send(g2CTest);	
+				}
+			}
 		}
 	}
 }

+ 14 - 0
Server/Hotfix/Handler/G2C_TestHandler.cs

@@ -0,0 +1,14 @@
+using ETModel;
+
+namespace ETHotfix
+{
+    [MessageHandler(AppType.Benchmark)]
+    public class G2C_TestHandler: AMHandler<G2C_Test>
+    {
+        public static int count = 0;
+        protected override void Run(Session session, G2C_Test message)
+        {
+            count++;
+        }
+    }
+}

+ 1 - 1
Server/Hotfix/Module/Message/InnerMessageDispatcher.cs

@@ -11,7 +11,7 @@ namespace ETHotfix
 			try
 			{
 				Type messageType = Game.Scene.GetComponent<OpcodeTypeComponent>().GetType(packet.Opcode);
-				message = (IMessage)session.Network.MessagePacker.DeserializeFrom(messageType, packet.Bytes, Packet.Index, packet.Length - Packet.Index);
+				message = (IMessage)session.Network.MessagePacker.DeserializeFrom(messageType, packet.Bytes, packet.Offset, packet.Length);
 			}
 			catch (Exception e)
 			{

+ 9 - 0
Server/Hotfix/Module/Message/NetInnerComponentSystem.cs

@@ -11,6 +11,15 @@ namespace ETHotfix
 			self.Awake();
 		}
 	}
+	
+	[ObjectSystem]
+	public class NetInnerComponentStartSystem : StartSystem<NetInnerComponent>
+	{
+		public override void Start(NetInnerComponent self)
+		{
+			self.Start();
+		}
+	}
 
 	[ObjectSystem]
 	public class NetInnerComponentAwake1System : AwakeSystem<NetInnerComponent, IPEndPoint>

+ 11 - 2
Server/Hotfix/Module/Message/NetOuterComponentSystem.cs

@@ -20,6 +20,15 @@ namespace ETHotfix
 			self.Awake(a);
 		}
 	}
+	
+	[ObjectSystem]
+	public class NetOuterComponentStartSystem : StartSystem<NetOuterComponent>
+	{
+		public override void Start(NetOuterComponent self)
+		{
+			self.Start();
+		}
+	}
 
 	[ObjectSystem]
 	public class NetOuterComponentUpdateSystem : UpdateSystem<NetOuterComponent>
@@ -34,14 +43,14 @@ namespace ETHotfix
 	{
 		public static void Awake(this NetOuterComponent self)
 		{
-			self.Awake(NetworkProtocol.TCP);
+			self.Awake(NetworkProtocol.KCP);
 			self.MessagePacker = new ProtobufPacker();
 			self.MessageDispatcher = new OuterMessageDispatcher();
 		}
 
 		public static void Awake(this NetOuterComponent self, IPEndPoint ipEndPoint)
 		{
-			self.Awake(NetworkProtocol.TCP, ipEndPoint);
+			self.Awake(NetworkProtocol.KCP, ipEndPoint);
 			self.MessagePacker = new ProtobufPacker();
 			self.MessageDispatcher = new OuterMessageDispatcher();
 		}

+ 6 - 1
Server/Hotfix/Module/Message/OuterMessage.cs

@@ -210,5 +210,10 @@ namespace ETHotfix
 		public string Message { get; set; }
 
 	}
-
+	
+	[Message(OuterOpcode.G2C_Test)]
+	[ProtoContract]
+	public partial class G2C_Test: IMessage
+	{
+	}
 }

+ 1 - 1
Server/Hotfix/Module/Message/OuterMessageDispatcher.cs

@@ -11,7 +11,7 @@ namespace ETHotfix
 			try
 			{
 				Type messageType = session.Network.Entity.GetComponent<OpcodeTypeComponent>().GetType(packet.Opcode);
-				message = session.Network.MessagePacker.DeserializeFrom(messageType, packet.Bytes, Packet.Index, packet.Length - Packet.Index);
+				message = session.Network.MessagePacker.DeserializeFrom(messageType, packet.Bytes, packet.Offset, packet.Length);
 				
 			}
 			catch (Exception e)

+ 1 - 0
Server/Hotfix/Module/Message/OuterOpcode.cs

@@ -16,5 +16,6 @@ namespace ETHotfix
 		 public const ushort M2C_Reload = 112;
 		 public const ushort C2R_Ping = 113;
 		 public const ushort R2C_Ping = 114;
+		 public const ushort G2C_Test = 115;
 	}
 }

+ 46 - 1
Unity/Assets/Scripts/Base/Object/ComponentFactory.cs

@@ -6,8 +6,13 @@ namespace ETModel
 	{
 		public static Component CreateWithParent(Type type, Component parent)
 		{
-			Component component = (Component)Game.ObjectPool.Fetch(type);
+			Component component = Game.ObjectPool.Fetch(type);
 			component.Parent = parent;
+			ComponentWithId componentWithId = component as ComponentWithId;
+			if (componentWithId != null)
+			{
+				componentWithId.Id = component.InstanceId;
+			}
 			Game.EventSystem.Awake(component);
 			return component;
 		}
@@ -16,6 +21,11 @@ namespace ETModel
 		{
 			T component = Game.ObjectPool.Fetch<T>();
 			component.Parent = parent;
+			ComponentWithId componentWithId = component as ComponentWithId;
+			if (componentWithId != null)
+			{
+				componentWithId.Id = component.InstanceId;
+			}
 			Game.EventSystem.Awake(component);
 			return component;
 		}
@@ -24,6 +34,11 @@ namespace ETModel
 		{
 			T component = Game.ObjectPool.Fetch<T>();
 			component.Parent = parent;
+			ComponentWithId componentWithId = component as ComponentWithId;
+			if (componentWithId != null)
+			{
+				componentWithId.Id = component.InstanceId;
+			}
 			Game.EventSystem.Awake(component, a);
 			return component;
 		}
@@ -32,6 +47,11 @@ namespace ETModel
 		{
 			T component = Game.ObjectPool.Fetch<T>();
 			component.Parent = parent;
+			ComponentWithId componentWithId = component as ComponentWithId;
+			if (componentWithId != null)
+			{
+				componentWithId.Id = component.InstanceId;
+			}
 			Game.EventSystem.Awake(component, a, b);
 			return component;
 		}
@@ -40,6 +60,11 @@ namespace ETModel
 		{
 			T component = Game.ObjectPool.Fetch<T>();
 			component.Parent = parent;
+			ComponentWithId componentWithId = component as ComponentWithId;
+			if (componentWithId != null)
+			{
+				componentWithId.Id = component.InstanceId;
+			}
 			Game.EventSystem.Awake(component, a, b, c);
 			return component;
 		}
@@ -47,6 +72,11 @@ namespace ETModel
 		public static T Create<T>() where T : Component
 		{
 			T component = Game.ObjectPool.Fetch<T>();
+			ComponentWithId componentWithId = component as ComponentWithId;
+			if (componentWithId != null)
+			{
+				componentWithId.Id = component.InstanceId;
+			}
 			Game.EventSystem.Awake(component);
 			return component;
 		}
@@ -54,6 +84,11 @@ namespace ETModel
 		public static T Create<T, A>(A a) where T : Component
 		{
 			T component = Game.ObjectPool.Fetch<T>();
+			ComponentWithId componentWithId = component as ComponentWithId;
+			if (componentWithId != null)
+			{
+				componentWithId.Id = component.InstanceId;
+			}
 			Game.EventSystem.Awake(component, a);
 			return component;
 		}
@@ -61,6 +96,11 @@ namespace ETModel
 		public static T Create<T, A, B>(A a, B b) where T : Component
 		{
 			T component = Game.ObjectPool.Fetch<T>();
+			ComponentWithId componentWithId = component as ComponentWithId;
+			if (componentWithId != null)
+			{
+				componentWithId.Id = component.InstanceId;
+			}
 			Game.EventSystem.Awake(component, a, b);
 			return component;
 		}
@@ -68,6 +108,11 @@ namespace ETModel
 		public static T Create<T, A, B, C>(A a, B b, C c) where T : Component
 		{
 			T component = Game.ObjectPool.Fetch<T>();
+			ComponentWithId componentWithId = component as ComponentWithId;
+			if (componentWithId != null)
+			{
+				componentWithId.Id = component.InstanceId;
+			}
 			Game.EventSystem.Awake(component, a, b, c);
 			return component;
 		}

+ 4 - 1
Unity/Assets/Scripts/Base/OneThreadSynchronizationContext.cs

@@ -6,9 +6,13 @@ namespace ETModel
 {
 	public class OneThreadSynchronizationContext : SynchronizationContext
 	{
+		public static OneThreadSynchronizationContext Instance = new OneThreadSynchronizationContext();
+
 		// 线程同步队列,发送接收socket回调都放到该队列,由poll线程统一执行
 		private readonly ConcurrentQueue<Action> queue = new ConcurrentQueue<Action>();
 
+		private Action a;
+
 		private void Add(Action action)
 		{
 			this.queue.Enqueue(action);
@@ -18,7 +22,6 @@ namespace ETModel
 		{
 			while (true)
 			{
-				Action a;
 				if (!this.queue.TryDequeue(out a))
 				{
 					return;

+ 12 - 0
Unity/Assets/Scripts/G2C_TestHandler.cs

@@ -0,0 +1,12 @@
+namespace ETModel
+{
+    [MessageHandler]
+    public class G2C_TestHandler: AMHandler<G2C_Test>
+    {
+        public static int count = 0;
+        protected override void Run(Session session, G2C_Test message)
+        {
+            count++;
+        }
+    }
+}

+ 13 - 0
Unity/Assets/Scripts/G2C_TestHandler.cs.meta

@@ -0,0 +1,13 @@
+fileFormatVersion: 2
+guid: 60b2c98954815df43a4fa750d6dd0b67
+timeCreated: 1528279930
+licenseType: Pro
+MonoImporter:
+  externalObjects: {}
+  serializedVersion: 2
+  defaultReferences: []
+  executionOrder: 0
+  icon: {instanceID: 0}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 2 - 4
Unity/Assets/Scripts/Init.cs

@@ -6,8 +6,6 @@ namespace ETModel
 {
 	public class Init : MonoBehaviour
 	{
-		private readonly OneThreadSynchronizationContext contex = new OneThreadSynchronizationContext();
-
 		private async void Start()
 		{
 			try
@@ -17,7 +15,7 @@ namespace ETModel
 					Log.Warning($"请使用Unity2017.1.3p2, 下载地址:\n https://beta.unity3d.com/download/744dab055778/UnityDownloadAssistant-2017.1.3p2.exe?_ga=2.42497696.443074145.1521714954-1119432033.1499739574");
 				}
 
-				SynchronizationContext.SetSynchronizationContext(this.contex);
+				SynchronizationContext.SetSynchronizationContext(OneThreadSynchronizationContext.Instance);
 
 				DontDestroyOnLoad(gameObject);
 				Game.EventSystem.Add(DLLType.Model, typeof(Init).Assembly);
@@ -55,7 +53,7 @@ namespace ETModel
 
 		private void Update()
 		{
-			this.contex.Update();
+			OneThreadSynchronizationContext.Instance.Update();
 			Game.Hotfix.Update?.Invoke();
 			Game.EventSystem.Update();
 		}

+ 1 - 1
Unity/Assets/Scripts/Module/Message/ClientDispatcher.cs

@@ -17,7 +17,7 @@ namespace ETModel
 
 				OpcodeTypeComponent opcodeTypeComponent = session.Network.Entity.GetComponent<OpcodeTypeComponent>();
 				Type responseType = opcodeTypeComponent.GetType(packet.Opcode);
-				message = session.Network.MessagePacker.DeserializeFrom(responseType, packet.Bytes, Packet.Index, packet.Length - Packet.Index);
+				message = session.Network.MessagePacker.DeserializeFrom(responseType, packet.Bytes, packet.Offset, packet.Length);
 			}
 			catch (Exception e)
 			{

+ 4 - 2
Unity/Assets/Scripts/Module/Message/ErrorCode.cs

@@ -13,11 +13,13 @@ namespace ETModel
 		public const int ERR_NotFoundUnit = 104;
 		public const int ERR_ConnectGateKeyError = 105;
 
-		public const int ERR_Exception = 1000;
-
 		public const int ERR_RpcFail = 2001;
 		public const int ERR_SocketDisconnected = 2002;
 		public const int ERR_ReloadFail = 2003;
 		public const int ERR_ActorLocationNotFound = 2004;
+
+		public const int ERR_Exception = 100000;
+
+		public const int ERR_SessionDispose = 100001;
 	}
 }

+ 10 - 1
Unity/Assets/Scripts/Module/Message/NetOuterComponent.cs

@@ -8,6 +8,15 @@
 			self.Awake();
 		}
 	}
+	
+	[ObjectSystem]
+	public class NetOuterComponentStartSystem : StartSystem<NetOuterComponent>
+	{
+		public override void Start(NetOuterComponent self)
+		{
+			self.Start();
+		}
+	}
 
 	[ObjectSystem]
 	public class NetOuterComponentUpdateSystem : UpdateSystem<NetOuterComponent>
@@ -22,7 +31,7 @@
 	{
 		public void Awake()
 		{
-			this.Awake(NetworkProtocol.TCP);
+			this.Awake(NetworkProtocol.KCP);
 			this.MessagePacker = new ProtobufPacker();
 			this.MessageDispatcher = new ClientDispatcher();
 		}

+ 14 - 17
Unity/Assets/Scripts/Module/Message/Network/AChannel.cs

@@ -1,8 +1,6 @@
 using System;
 using System.Collections.Generic;
 using System.Net;
-using System.Net.Sockets;
-using System.Threading.Tasks;
 
 namespace ETModel
 {
@@ -21,6 +19,11 @@ namespace ETModel
 		Accept,
 	}
 
+	public class UserTokenInfo
+	{
+		public long InstanceId;
+	}
+
 	public abstract class AChannel: ComponentWithId
 	{
 		public ChannelType ChannelType { get; }
@@ -56,39 +59,33 @@ namespace ETModel
 				this.readCallback -= value;
 			}
 		}
-
+		
 		protected void OnRead(Packet packet)
 		{
-			if (this.IsDisposed)
-			{
-				return;
-			}
-			this.readCallback?.Invoke(packet);
+			this.readCallback.Invoke(packet);
 		}
 
-		protected void OnError(int error)
+		protected void OnError(int e)
 		{
-			if (this.IsDisposed)
-			{
-				return;
-			}
-			this.errorCallback?.Invoke(this, error);
+			this.errorCallback?.Invoke(this, e);
 		}
 
-
 		protected AChannel(AService service, ChannelType channelType)
 		{
+			this.Id = IdGenerater.GenerateId();
 			this.ChannelType = channelType;
 			this.service = service;
 		}
-		
+
+		public abstract void Start();
+
 		/// <summary>
 		/// 发送消息
 		/// </summary>
 		public abstract void Send(byte[] buffer, int index, int length);
 
 		public abstract void Send(List<byte[]> buffers);
-
+		
 		public override void Dispose()
 		{
 			if (this.IsDisposed)

+ 21 - 3
Unity/Assets/Scripts/Module/Message/Network/AService.cs

@@ -1,25 +1,43 @@
 using System;
 using System.Net;
-using System.Threading.Tasks;
 
 namespace ETModel
 {
 	public enum NetworkProtocol
 	{
-		TCP,
 		KCP,
+		TCP,
 	}
 
 	public abstract class AService: Component
 	{
 		public abstract AChannel GetChannel(long id);
 
-		public abstract Task<AChannel> AcceptChannel();
+		private Action<AChannel> acceptCallback;
+
+		public event Action<AChannel> AcceptCallback
+		{
+			add
+			{
+				this.acceptCallback += value;
+			}
+			remove
+			{
+				this.acceptCallback -= value;
+			}
+		}
+		
+		protected void OnAccept(AChannel channel)
+		{
+			this.acceptCallback.Invoke(channel);
+		}
 
 		public abstract AChannel ConnectChannel(IPEndPoint ipEndPoint);
 
 		public abstract void Remove(long channelId);
 
 		public abstract void Update();
+
+		public abstract void Start();
 	}
 }

+ 34 - 41
Unity/Assets/Scripts/Module/Message/Network/KCP/KChannel.cs

@@ -3,7 +3,6 @@ using System.Collections.Generic;
 using System.Linq;
 using System.Net;
 using System.Net.Sockets;
-using System.Threading.Tasks;
 
 namespace ETModel
 {
@@ -21,16 +20,14 @@ namespace ETModel
 		}
 	}
 
-	public class KChannel: AChannel
+	public class KChannel : AChannel
 	{
-		private UdpClient socket;
+		private Socket socket;
 
-		private Kcp kcp;
+		private KCP kcp;
 
-		private readonly CircularBuffer recvBuffer = new CircularBuffer();
 		private readonly Queue<WaitSendBuffer> sendBuffer = new Queue<WaitSendBuffer>();
 
-		private readonly PacketParser parser;
 		private bool isConnected;
 		private readonly IPEndPoint remoteEndPoint;
 
@@ -42,29 +39,30 @@ namespace ETModel
 
 		public uint RemoteConn;
 
+		public uint lastConnectTime;
+
 		// accept
-		public KChannel(uint conn, uint remoteConn, UdpClient socket, IPEndPoint remoteEndPoint, KService kService): base(kService, ChannelType.Accept)
+		public KChannel(uint conn, uint remoteConn, Socket socket, IPEndPoint remoteEndPoint, KService kService) : base(kService, ChannelType.Accept)
 		{
 			this.Id = conn;
 			this.Conn = conn;
 			this.RemoteConn = remoteConn;
 			this.remoteEndPoint = remoteEndPoint;
 			this.socket = socket;
-			this.parser = new PacketParser(this.recvBuffer);
-			kcp = new Kcp(this.RemoteConn, this.Output);
-			kcp.SetMtu(512);
+			kcp = new KCP(this.RemoteConn, this);
+			kcp.SetOutput(this.Output);
 			kcp.NoDelay(1, 10, 2, 1);  //fast
 			this.isConnected = true;
+
 			this.lastRecvTime = kService.TimeNow;
 		}
 
 		// connect
-		public KChannel(uint conn, UdpClient socket, IPEndPoint remoteEndPoint, KService kService): base(kService, ChannelType.Connect)
+		public KChannel(uint conn, Socket socket, IPEndPoint remoteEndPoint, KService kService) : base(kService, ChannelType.Connect)
 		{
 			this.Id = conn;
 			this.Conn = conn;
 			this.socket = socket;
-			this.parser = new PacketParser(this.recvBuffer);
 
 			this.remoteEndPoint = remoteEndPoint;
 			this.lastRecvTime = kService.TimeNow;
@@ -100,10 +98,9 @@ namespace ETModel
 				return;
 			}
 			this.isConnected = true;
-
 			this.RemoteConn = responseConn;
-			this.kcp = new Kcp(responseConn, this.Output);
-			kcp.SetMtu(512);
+			this.kcp = new KCP(responseConn, this);
+			kcp.SetOutput(this.Output);
 			kcp.NoDelay(1, 10, 2, 1);  //fast
 
 			HandleSend();
@@ -114,7 +111,7 @@ namespace ETModel
 			cacheBytes.WriteTo(0, KcpProtocalType.ACK);
 			cacheBytes.WriteTo(4, requestConn);
 			cacheBytes.WriteTo(8, this.Conn);
-			this.socket.Send(cacheBytes, 12, remoteEndPoint);
+			this.socket.SendTo(cacheBytes, 0, 12, SocketFlags.None, remoteEndPoint);
 		}
 
 		/// <summary>
@@ -124,8 +121,7 @@ namespace ETModel
 		{
 			cacheBytes.WriteTo(0, KcpProtocalType.SYN);
 			cacheBytes.WriteTo(4, this.Conn);
-			//Log.Debug($"client connect: {this.Conn}");
-			this.socket.Send(cacheBytes, 8, remoteEndPoint);
+			this.socket.SendTo(cacheBytes, 0, 8, SocketFlags.None, remoteEndPoint);
 
 			// 200毫秒后再次update发送connect请求
 			this.GetService().AddToNextTimeUpdate(timeNow + 200, this.Id);
@@ -137,7 +133,7 @@ namespace ETModel
 			cacheBytes.WriteTo(4, this.Conn);
 			cacheBytes.WriteTo(8, this.RemoteConn);
 			//Log.Debug($"client disconnect: {this.Conn}");
-			this.socket.Send(cacheBytes, 12, remoteEndPoint);
+			this.socket.SendTo(cacheBytes, 0, 12, SocketFlags.None, remoteEndPoint);
 		}
 
 		public void Update(uint timeNow)
@@ -148,7 +144,7 @@ namespace ETModel
 				Connect(timeNow);
 				return;
 			}
-
+			
 			// 超时断开连接
 			if (timeNow - this.lastRecvTime > 20 * 1000)
 			{
@@ -156,6 +152,7 @@ namespace ETModel
 				return;
 			}
 			this.kcp.Update(timeNow);
+
 			uint nextUpdateTime = this.kcp.Check(timeNow);
 			this.GetService().AddToNextTimeUpdate(nextUpdateTime, this.Id);
 		}
@@ -173,10 +170,9 @@ namespace ETModel
 			}
 		}
 
-		public void HandleRecv(byte[] date, uint timeNow)
+		public void HandleRecv(byte[] date, int length, uint timeNow)
 		{
-			this.kcp.Input(date);
-			// 加入update队列
+			this.kcp.Input(date, 0, length);
 			this.GetService().AddToUpdate(this.Id);
 
 			while (true)
@@ -187,7 +183,7 @@ namespace ETModel
 					this.OnError((int)SocketError.NetworkReset);
 					return;
 				}
-				int count = this.kcp.Recv(this.cacheBytes);
+				int count = this.kcp.Recv(this.cacheBytes, 0, this.cacheBytes.Length);
 				if (count <= 0)
 				{
 					return;
@@ -195,27 +191,20 @@ namespace ETModel
 
 				lastRecvTime = timeNow;
 
-				// 收到的数据放入缓冲区
-				byte[] sizeBuffer = BitConverter.GetBytes((ushort)count);
-				this.recvBuffer.Write(sizeBuffer, 0, sizeBuffer.Length);
-				this.recvBuffer.Write(cacheBytes, 0, count);
-
-				while (true)
-				{
-					if (!this.parser.Parse())
-					{
-						break;
-					}
-
-					Packet packet = this.parser.GetPacket();
-					this.OnRead(packet);
-				}
+				this.packet.Flag = this.cacheBytes[0];
+				this.packet.Opcode = BitConverter.ToUInt16(this.cacheBytes, 1);
+				this.packet.Bytes = this.cacheBytes;
+				this.packet.Offset = Packet.Index;
+				this.packet.Length = (ushort) (count - Packet.Index);
+				this.OnRead(packet);
 			}
 		}
+		
+		public Packet packet = new Packet();
 
-		public void Output(byte[] bytes, int count)
+		public void Output(byte[] bytes, int count, object user)
 		{
-			this.socket.Send(bytes, count, this.remoteEndPoint);
+			this.socket.SendTo(bytes, 0, count, SocketFlags.None, this.remoteEndPoint);
 		}
 
 		private void KcpSend(byte[] buffers, int index, int length)
@@ -224,6 +213,10 @@ namespace ETModel
 			this.GetService().AddToUpdate(this.Id);
 		}
 
+		public override void Start()
+		{
+		}
+
 		public override void Send(byte[] buffer, int index, int length)
 		{
 			if (isConnected)

+ 103 - 107
Unity/Assets/Scripts/Module/Message/Network/KCP/KService.cs

@@ -3,7 +3,6 @@ using System.Collections.Generic;
 using System.Net;
 using System.Net.Sockets;
 using System.Runtime.InteropServices;
-using System.Threading.Tasks;
 
 namespace ETModel
 {
@@ -20,11 +19,11 @@ namespace ETModel
 
 		public uint TimeNow { get; set; }
 
-		private UdpClient socket;
+		private Socket socket;
 
 		private readonly Dictionary<long, KChannel> idChannels = new Dictionary<long, KChannel>();
-
-		private TaskCompletionSource<AChannel> acceptTcs;
+		
+		private readonly byte[] cache = new byte[8192];
 
 		private readonly Queue<long> removedChannels = new Queue<long>();
 
@@ -35,163 +34,173 @@ namespace ETModel
 		private readonly MultiMap<long, long> timerId = new MultiMap<long, long>();
 
 		private readonly List<long> timeOutId = new List<long>();
+		
+		private EndPoint ipEndPoint = new IPEndPoint(IPAddress.Any, 0);
 
 		public KService(IPEndPoint ipEndPoint)
 		{
-			this.TimeNow = (uint)TimeHelper.Now();
-			this.socket = new UdpClient(ipEndPoint);
-
+			this.TimeNow = (uint)TimeHelper.ClientNow();
+			this.socket = new Socket(AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.Udp);
+			this.socket.Bind(ipEndPoint);
 #if SERVER
 			if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
 			{
 				const uint IOC_IN = 0x80000000;
 				const uint IOC_VENDOR = 0x18000000;
 				uint SIO_UDP_CONNRESET = IOC_IN | IOC_VENDOR | 12;
-				this.socket.Client.IOControl((int)SIO_UDP_CONNRESET, new[] { Convert.ToByte(false) }, null);
+				this.socket.IOControl((int)SIO_UDP_CONNRESET, new[] { Convert.ToByte(false) }, null);
 			}
 #endif
-
-			this.StartRecv();
 		}
 
 		public KService()
 		{
-			this.TimeNow = (uint)TimeHelper.Now();
-			this.socket = new UdpClient(new IPEndPoint(IPAddress.Any, 0));
-			this.StartRecv();
+			this.TimeNow = (uint)TimeHelper.ClientNow();
+			this.socket = new Socket(AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.Udp);
+			this.socket.Bind(new IPEndPoint(IPAddress.Any, 0));
+#if SERVER
+			if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
+			{
+				const uint IOC_IN = 0x80000000;
+				const uint IOC_VENDOR = 0x18000000;
+				uint SIO_UDP_CONNRESET = IOC_IN | IOC_VENDOR | 12;
+				this.socket.IOControl((int)SIO_UDP_CONNRESET, new[] { Convert.ToByte(false) }, null);
+			}
+#endif
 		}
 
 		public override void Dispose()
 		{
-			if (this.socket == null)
+			if (this.IsDisposed)
 			{
 				return;
 			}
+			
+			base.Dispose();
+
+			foreach (KeyValuePair<long,KChannel> keyValuePair in this.idChannels)
+			{
+				keyValuePair.Value.Dispose();
+			}
 
 			this.socket.Close();
 			this.socket = null;
 		}
 
-		public async void StartRecv()
+		public override void Start()
 		{
-			while (true)
+		}
+
+		public void Recv()
+		{
+			while (this.socket.Available > 0)
 			{
-				if (this.socket == null)
+				if (this.IsDisposed)
 				{
 					return;
 				}
 
-				UdpReceiveResult udpReceiveResult;
+				int messageLength = 0;
 				try
 				{
-					udpReceiveResult = await this.socket.ReceiveAsync();
+					messageLength = this.socket.ReceiveFrom(this.cache, ref this.ipEndPoint);
 				}
-				catch (Exception e)
+				catch (Exception)
+				{
+					return;
+				}
+
+				// 长度小于4,不是正常的消息
+				if (messageLength < 4)
 				{
-					Log.Error(e);
 					continue;
 				}
 
-				try
+				// accept
+				uint conn = BitConverter.ToUInt32(this.cache, 0);
+
+				// conn从1000开始,如果为1,2,3则是特殊包
+				switch (conn)
 				{
-					int messageLength = udpReceiveResult.Buffer.Length;
-
-					// 长度小于4,不是正常的消息
-					if (messageLength < 4)
-					{
-						continue;
-					}
-
-					// accept
-					uint conn = BitConverter.ToUInt32(udpReceiveResult.Buffer, 0);
-
-					// conn从1000开始,如果为1,2,3则是特殊包
-					switch (conn)
-					{
-						case KcpProtocalType.SYN:
-							// 长度!=8,不是accpet消息
-							if (messageLength != 8)
-							{
-								break;
-							}
-							this.HandleAccept(udpReceiveResult);
+					case KcpProtocalType.SYN:
+						// 长度!=8,不是accpet消息
+						if (messageLength != 8)
+						{
 							break;
-						case KcpProtocalType.ACK:
-							// 长度!=12,不是connect消息
-							if (messageLength != 12)
-							{
-								break;
-							}
-							this.HandleConnect(udpReceiveResult);
+						}
+
+						IPEndPoint acceptIpEndPoint = (IPEndPoint)this.ipEndPoint;
+						this.ipEndPoint = new IPEndPoint(0, 0);
+						this.HandleAccept(this.cache, acceptIpEndPoint);
+						break;
+					case KcpProtocalType.ACK:
+						// 长度!=12,不是connect消息
+						if (messageLength != 12)
+						{
 							break;
-						case KcpProtocalType.FIN:
-							// 长度!=12,不是DisConnect消息
-							if (messageLength != 12)
-							{
-								break;
-							}
-							this.HandleDisConnect(udpReceiveResult);
+						}
+						this.HandleConnect(this.cache);
+						break;
+					case KcpProtocalType.FIN:
+						// 长度!=12,不是DisConnect消息
+						if (messageLength != 12)
+						{
 							break;
-						default:
-							this.HandleRecv(udpReceiveResult, conn);
-							break;
-					}
-				}
-				catch (Exception e)
-				{
-					Log.Error(e);
-					continue;
+						}
+						this.HandleDisConnect(this.cache);
+						break;
+					default:
+						this.HandleRecv(this.cache, messageLength, conn);
+						break;
 				}
 			}
 		}
 
-		private void HandleConnect(UdpReceiveResult udpReceiveResult)
+		private void HandleConnect(byte[] bytes)
 		{
-			uint requestConn = BitConverter.ToUInt32(udpReceiveResult.Buffer, 4);
-			uint responseConn = BitConverter.ToUInt32(udpReceiveResult.Buffer, 8);
+			uint requestConn = BitConverter.ToUInt32(bytes, 4);
+			uint responseConn = BitConverter.ToUInt32(bytes, 8);
 
 			KChannel kChannel;
 			if (!this.idChannels.TryGetValue(requestConn, out kChannel))
 			{
 				return;
 			}
+
 			// 处理chanel
 			kChannel.HandleConnnect(responseConn);
 		}
 
-		private void HandleDisConnect(UdpReceiveResult udpReceiveResult)
+		private void HandleDisConnect(byte[] bytes)
 		{
-			uint requestConn = BitConverter.ToUInt32(udpReceiveResult.Buffer, 8);
+			uint requestConn = BitConverter.ToUInt32(bytes, 8);
 
 			KChannel kChannel;
 			if (!this.idChannels.TryGetValue(requestConn, out kChannel))
 			{
 				return;
 			}
+
 			// 处理chanel
 			this.idChannels.Remove(requestConn);
 			kChannel.Dispose();
 		}
 
-		private void HandleRecv(UdpReceiveResult udpReceiveResult, uint conn)
+		private void HandleRecv(byte[] bytes, int length, uint conn)
 		{
 			KChannel kChannel;
 			if (!this.idChannels.TryGetValue(conn, out kChannel))
 			{
 				return;
 			}
+
 			// 处理chanel
-			kChannel.HandleRecv(udpReceiveResult.Buffer, this.TimeNow);
+			kChannel.HandleRecv(bytes, length, this.TimeNow);
 		}
 
-		private void HandleAccept(UdpReceiveResult udpReceiveResult)
+		private void HandleAccept(byte[] bytes, IPEndPoint remoteEndPoint)
 		{
-			if (this.acceptTcs == null)
-			{
-				return;
-			}
-
-			uint requestConn = BitConverter.ToUInt32(udpReceiveResult.Buffer, 4);
+			uint requestConn = BitConverter.ToUInt32(bytes, 4);
 
 			// 如果已经连接上,则重新响应请求
 			KChannel kChannel;
@@ -201,11 +210,9 @@ namespace ETModel
 				return;
 			}
 
-			TaskCompletionSource<AChannel> t = this.acceptTcs;
-			this.acceptTcs = null;
-			kChannel = this.CreateAcceptChannel(udpReceiveResult.RemoteEndPoint, requestConn);
+			kChannel = this.CreateAcceptChannel(remoteEndPoint, requestConn);
 			kChannel.HandleAccept(requestConn);
-			t.SetResult(kChannel);
+			this.OnAccept(kChannel);
 		}
 
 		private KChannel CreateAcceptChannel(IPEndPoint remoteEndPoint, uint remoteConn)
@@ -221,7 +228,14 @@ namespace ETModel
 			return channel;
 		}
 
-		private KChannel CreateConnectChannel(IPEndPoint remoteEndPoint)
+		public override AChannel GetChannel(long id)
+		{
+			KChannel channel;
+			this.idChannels.TryGetValue(id, out channel);
+			return channel;
+		}
+
+		public override AChannel ConnectChannel(IPEndPoint remoteEndPoint)
 		{
 			uint conv = (uint)RandomHelper.RandomNumber(1000, int.MaxValue);
 			KChannel channel = new KChannel(conv, this.socket, remoteEndPoint, this);
@@ -245,26 +259,6 @@ namespace ETModel
 			this.timerId.Add(time, id);
 		}
 
-		public override AChannel GetChannel(long id)
-		{
-			KChannel channel;
-			this.idChannels.TryGetValue(id, out channel);
-			return channel;
-		}
-
-		public override Task<AChannel> AcceptChannel()
-		{
-			acceptTcs = new TaskCompletionSource<AChannel>();
-			return this.acceptTcs.Task;
-		}
-
-		public override AChannel ConnectChannel(IPEndPoint ipEndPoint)
-		{
-			KChannel channel = this.CreateConnectChannel(ipEndPoint);
-			return channel;
-		}
-
-
 		public override void Remove(long id)
 		{
 			KChannel channel;
@@ -279,9 +273,11 @@ namespace ETModel
 			this.removedChannels.Enqueue(id);
 			channel.Dispose();
 		}
-
+		
 		public override void Update()
 		{
+			this.Recv();
+			
 			this.TimerOut();
 
 			foreach (long id in updateChannels)
@@ -319,7 +315,7 @@ namespace ETModel
 			}
 
 			this.TimeNow = (uint)TimeHelper.ClientNow();
-
+			
 			timeOutId.Clear();
 
 			while (this.timerId.Count > 0)

+ 1154 - 1179
Unity/Assets/Scripts/Module/Message/Network/KCP/Kcp.cs

@@ -1,1181 +1,1156 @@
-using System;
+// Copyright (C) 2017 ichenq@outlook.com. All rights reserved.
+// Distributed under the terms and conditions of the MIT License.
+// See accompanying files LICENSE.
 
-public class Kcp
+using System;
+using System.Diagnostics;
+using System.Collections.Generic;
+
+namespace ETModel
 {
-	public const int IKCP_RTO_NDL = 30; // no delay min rto
-	public const int IKCP_RTO_MIN = 100; // normal min rto
-	public const int IKCP_RTO_DEF = 200;
-	public const int IKCP_RTO_MAX = 60000;
-	public const int IKCP_CMD_PUSH = 81; // cmd: push data
-	public const int IKCP_CMD_ACK = 82; // cmd: ack
-	public const int IKCP_CMD_WASK = 83; // cmd: window probe (ask)
-	public const int IKCP_CMD_WINS = 84; // cmd: window size (tell)
-	public const int IKCP_ASK_SEND = 1; // need to send IKCP_CMD_WASK
-	public const int IKCP_ASK_TELL = 2; // need to send IKCP_CMD_WINS
-	public const int IKCP_WND_SND = 32;
-	public const int IKCP_WND_RCV = 32;
-	public const int IKCP_MTU_DEF = 1024;
-	public const int IKCP_ACK_FAST = 3;
-	public const int IKCP_INTERVAL = 100;
-	public const int IKCP_OVERHEAD = 24;
-	public const int IKCP_DEADLINK = 10;
-	public const int IKCP_THRESH_INIT = 2;
-	public const int IKCP_THRESH_MIN = 2;
-	public const int IKCP_PROBE_INIT = 7000; // 7 secs to probe window size
-	public const int IKCP_PROBE_LIMIT = 120000; // up to 120 secs to probe window
-
-	// encode 8 bits unsigned int
-	public static int ikcp_encode8u(byte[] p, int offset, byte c)
-	{
-		p[0 + offset] = c;
-		return 1;
-	}
-
-	// decode 8 bits unsigned int
-	public static int ikcp_decode8u(byte[] p, int offset, ref byte c)
-	{
-		c = p[0 + offset];
-		return 1;
-	}
-
-	/* encode 16 bits unsigned int (lsb) */
-	public static int ikcp_encode16u(byte[] p, int offset, UInt16 w)
-	{
-		p[0 + offset] = (byte)(w >> 0);
-		p[1 + offset] = (byte)(w >> 8);
-		return 2;
-	}
-
-	/* decode 16 bits unsigned int (lsb) */
-	public static int ikcp_decode16u(byte[] p, int offset, ref UInt16 c)
-	{
-		UInt16 result = 0;
-		result |= p[0 + offset];
-		result |= (UInt16)(p[1 + offset] << 8);
-		c = result;
-		return 2;
-	}
-
-	/* encode 32 bits unsigned int (lsb) */
-	public static int ikcp_encode32u(byte[] p, int offset, UInt32 l)
-	{
-		p[0 + offset] = (byte)(l >> 0);
-		p[1 + offset] = (byte)(l >> 8);
-		p[2 + offset] = (byte)(l >> 16);
-		p[3 + offset] = (byte)(l >> 24);
-		return 4;
-	}
-
-	/* decode 32 bits unsigned int (lsb) */
-	public static int ikcp_decode32u(byte[] p, int offset, ref UInt32 c)
-	{
-		UInt32 result = 0;
-		result |= p[0 + offset];
-		result |= (UInt32)(p[1 + offset] << 8);
-		result |= (UInt32)(p[2 + offset] << 16);
-		result |= (UInt32)(p[3 + offset] << 24);
-		c = result;
-		return 4;
-	}
-
-	public static byte[] slice(byte[] p, int start, int stop)
-	{
-		var bytes = new byte[stop - start];
-		Array.Copy(p, start, bytes, 0, bytes.Length);
-		return bytes;
-	}
-
-	public static T[] slice<T>(T[] p, int start, int stop)
-	{
-		var arr = new T[stop - start];
-		int index = 0;
-		for (int i = start; i < stop; i++)
-		{
-			arr[index] = p[i];
-			index++;
-		}
-
-		return arr;
-	}
-
-	public static byte[] append(byte[] p, byte c)
-	{
-		var bytes = new byte[p.Length + 1];
-		Array.Copy(p, bytes, p.Length);
-		bytes[p.Length] = c;
-		return bytes;
-	}
-
-	public static T[] append<T>(T[] p, T c)
-	{
-		var arr = new T[p.Length + 1];
-		for (int i = 0; i < p.Length; i++)
-		{
-			arr[i] = p[i];
-		}
-
-		arr[p.Length] = c;
-		return arr;
-	}
-
-	public static T[] append<T>(T[] p, T[] cs)
-	{
-		var arr = new T[p.Length + cs.Length];
-		for (int i = 0; i < p.Length; i++)
-		{
-			arr[i] = p[i];
-		}
-
-		for (int i = 0; i < cs.Length; i++)
-		{
-			arr[p.Length + i] = cs[i];
-		}
-
-		return arr;
-	}
-
-	private static UInt32 _imin_(UInt32 a, UInt32 b)
-	{
-		return a <= b ? a : b;
-	}
-
-	private static UInt32 _imax_(UInt32 a, UInt32 b)
-	{
-		return a >= b ? a : b;
-	}
-
-	private static UInt32 _ibound_(UInt32 lower, UInt32 middle, UInt32 upper)
-	{
-		return _imin_(_imax_(lower, middle), upper);
-	}
-
-	private static Int32 _itimediff(UInt32 later, UInt32 earlier)
-	{
-		return (Int32)(later - earlier);
-	}
-
-	// KCP Segment Definition
-	internal class Segment
-	{
-		internal UInt32 conv;
-		internal UInt32 cmd;
-		internal UInt32 frg;
-		internal UInt32 wnd;
-		internal UInt32 ts;
-		internal UInt32 sn;
-		internal UInt32 una;
-		internal UInt32 resendts;
-		internal UInt32 rto;
-		internal UInt32 fastack;
-		internal UInt32 xmit;
-		internal byte[] data;
-
-		internal Segment(int size)
-		{
-			this.data = new byte[size];
-		}
-
-		// encode a segment into buffer
-		internal int encode(byte[] ptr, int offset)
-		{
-			int offset_ = offset;
-
-			offset += ikcp_encode32u(ptr, offset, conv);
-			offset += ikcp_encode8u(ptr, offset, (byte)cmd);
-			offset += ikcp_encode8u(ptr, offset, (byte)frg);
-			offset += ikcp_encode16u(ptr, offset, (UInt16)wnd);
-			offset += ikcp_encode32u(ptr, offset, ts);
-			offset += ikcp_encode32u(ptr, offset, sn);
-			offset += ikcp_encode32u(ptr, offset, una);
-			offset += ikcp_encode32u(ptr, offset, (UInt32)data.Length);
-
-			return offset - offset_;
-		}
-	}
-
-	// kcp members.
-	private readonly UInt32 conv;
-
-	private UInt32 mtu;
-	private UInt32 mss;
-	private UInt32 state;
-	private UInt32 snd_una;
-	private UInt32 snd_nxt;
-	private UInt32 rcv_nxt;
-	private UInt32 ts_recent;
-	private UInt32 ts_lastack;
-	private UInt32 ssthresh;
-	private UInt32 rx_rttval;
-	private UInt32 rx_srtt;
-	private UInt32 rx_rto;
-	private UInt32 rx_minrto;
-	private UInt32 snd_wnd;
-	private UInt32 rcv_wnd;
-	private UInt32 rmt_wnd;
-	private UInt32 cwnd;
-	private UInt32 probe;
-	private UInt32 current;
-	private UInt32 interval;
-	private UInt32 ts_flush;
-	private UInt32 xmit;
-	private UInt32 nodelay;
-	private UInt32 updated;
-	private UInt32 ts_probe;
-	private UInt32 probe_wait;
-	private readonly UInt32 dead_link;
-	private UInt32 incr;
-
-	private Segment[] snd_queue = new Segment[0];
-	private Segment[] rcv_queue = new Segment[0];
-	private Segment[] snd_buf = new Segment[0];
-	private Segment[] rcv_buf = new Segment[0];
-
-	private UInt32[] acklist = new UInt32[0];
-
-	private byte[] buffer;
-	private Int32 fastresend;
-	private Int32 nocwnd;
-
-	private Int32 logmask;
-
-	// buffer, size
-	private readonly Action<byte[], int> output;
-
-	// create a new kcp control object, 'conv' must equal in two endpoint
-	// from the same connection.
-	public Kcp(UInt32 conv_, Action<byte[], int> output_)
-	{
-		conv = conv_;
-		snd_wnd = IKCP_WND_SND;
-		rcv_wnd = IKCP_WND_RCV;
-		rmt_wnd = IKCP_WND_RCV;
-		mtu = IKCP_MTU_DEF;
-		mss = mtu - IKCP_OVERHEAD;
-
-		rx_rto = IKCP_RTO_DEF;
-		rx_minrto = IKCP_RTO_MIN;
-		interval = IKCP_INTERVAL;
-		ts_flush = IKCP_INTERVAL;
-		ssthresh = IKCP_THRESH_INIT;
-		dead_link = IKCP_DEADLINK;
-		buffer = new byte[(mtu + IKCP_OVERHEAD) * 3];
-		output = output_;
-	}
-
-	// check the size of next message in the recv queue
-	public int PeekSize()
-	{
-		if (0 == rcv_queue.Length)
-		{
-			return -1;
-		}
-
-		Segment seq = rcv_queue[0];
-
-		if (0 == seq.frg)
-		{
-			return seq.data.Length;
-		}
-
-		if (rcv_queue.Length < seq.frg + 1)
-		{
-			return -1;
-		}
-
-		int length = 0;
-
-		foreach (Segment item in rcv_queue)
-		{
-			length += item.data.Length;
-			if (0 == item.frg)
-			{
-				break;
-			}
-		}
-
-		return length;
-	}
-
-	// user/upper level recv: returns size, returns below zero for EAGAIN
-	public int Recv(byte[] buffer)
-	{
-		if (0 == rcv_queue.Length)
-		{
-			return -1;
-		}
-
-		int peekSize = PeekSize();
-		if (0 > peekSize)
-		{
-			return -2;
-		}
-
-		if (peekSize > buffer.Length)
-		{
-			return -3;
-		}
-
-		bool fast_recover = false;
-		if (rcv_queue.Length >= rcv_wnd)
-		{
-			fast_recover = true;
-		}
-
-		// merge fragment.
-		int count = 0;
-		int n = 0;
-		foreach (Segment seg in rcv_queue)
-		{
-			Array.Copy(seg.data, 0, buffer, n, seg.data.Length);
-			n += seg.data.Length;
-			count++;
-			if (0 == seg.frg)
-			{
-				break;
-			}
-		}
-
-		if (0 < count)
-		{
-			this.rcv_queue = slice(this.rcv_queue, count, this.rcv_queue.Length);
-		}
-
-		// move available data from rcv_buf -> rcv_queue
-		count = 0;
-		foreach (Segment seg in rcv_buf)
-		{
-			if (seg.sn == this.rcv_nxt && this.rcv_queue.Length < this.rcv_wnd)
-			{
-				this.rcv_queue = append(this.rcv_queue, seg);
-				this.rcv_nxt++;
-				count++;
-			}
-			else
-			{
-				break;
-			}
-		}
-
-		if (0 < count)
-		{
-			this.rcv_buf = slice(this.rcv_buf, count, this.rcv_buf.Length);
-		}
-
-		// fast recover
-		if (rcv_queue.Length < rcv_wnd && fast_recover)
-		{
-			this.probe |= IKCP_ASK_TELL;
-		}
-
-		return n;
-	}
-
-	// user/upper level send, returns below zero for error
-	public int Send(byte[] bytes, int index, int length)
-	{
-		if (0 == bytes.Length)
-		{
-			return -1;
-		}
-
-		if (length == 0)
-		{
-			return -1;
-		}
-
-		int count = 0;
-
-		if (length < mss)
-		{
-			count = 1;
-		}
-		else
-		{
-			count = (int)(length + this.mss - 1) / (int)this.mss;
-		}
-
-		if (255 < count)
-		{
-			return -2;
-		}
-
-		if (0 == count)
-		{
-			count = 1;
-		}
-
-		int offset = 0;
-
-		for (int i = 0; i < count; i++)
-		{
-			int size = 0;
-			if (length - offset > mss)
-			{
-				size = (int)this.mss;
-			}
-			else
-			{
-				size = length - offset;
-			}
-
-			Segment seg = new Segment(size);
-			Array.Copy(bytes, offset + index, seg.data, 0, size);
-			offset += size;
-			seg.frg = (UInt32)(count - i - 1);
-			snd_queue = append(snd_queue, seg);
-		}
-
-		return 0;
-	}
-
-	// update ack.
-	private void update_ack(Int32 rtt)
-	{
-		if (0 == rx_srtt)
-		{
-			rx_srtt = (UInt32)rtt;
-			rx_rttval = (UInt32)rtt / 2;
-		}
-		else
-		{
-			Int32 delta = (Int32)((UInt32)rtt - rx_srtt);
-			if (0 > delta)
-			{
-				delta = -delta;
-			}
-
-			rx_rttval = (3 * rx_rttval + (uint)delta) / 4;
-			rx_srtt = (UInt32)((7 * rx_srtt + rtt) / 8);
-			if (rx_srtt < 1)
-			{
-				this.rx_srtt = 1;
-			}
-		}
-
-		int rto = (int)(rx_srtt + _imax_(1, 4 * rx_rttval));
-		rx_rto = _ibound_(rx_minrto, (UInt32)rto, IKCP_RTO_MAX);
-	}
-
-	private void shrink_buf()
-	{
-		if (snd_buf.Length > 0)
-		{
-			this.snd_una = this.snd_buf[0].sn;
-		}
-		else
-		{
-			this.snd_una = this.snd_nxt;
-		}
-	}
-
-	private void parse_ack(UInt32 sn)
-	{
-		if (_itimediff(sn, snd_una) < 0 || _itimediff(sn, snd_nxt) >= 0)
-		{
-			return;
-		}
-
-		int index = 0;
-		foreach (Segment seg in snd_buf)
-		{
-			if (sn == seg.sn)
-			{
-				snd_buf = append(slice(snd_buf, 0, index), slice(snd_buf, index + 1, snd_buf.Length));
-				break;
-			}
-			seg.fastack++;
-
-			index++;
-		}
-	}
-
-	private void parse_una(UInt32 una)
-	{
-		int count = 0;
-		foreach (Segment seg in snd_buf)
-		{
-			if (_itimediff(una, seg.sn) > 0)
-			{
-				count++;
-			}
-			else
-			{
-				break;
-			}
-		}
-
-		if (0 < count)
-		{
-			this.snd_buf = slice(this.snd_buf, count, this.snd_buf.Length);
-		}
-	}
-
-	private void ack_push(UInt32 sn, UInt32 ts)
-	{
-		acklist = append(acklist, new UInt32[2] { sn, ts });
-	}
-
-	private void ack_get(int p, ref UInt32 sn, ref UInt32 ts)
-	{
-		sn = acklist[p * 2 + 0];
-		ts = acklist[p * 2 + 1];
-	}
-
-	private void parse_data(Segment newseg)
-	{
-		uint sn = newseg.sn;
-		if (_itimediff(sn, rcv_nxt + rcv_wnd) >= 0 || _itimediff(sn, rcv_nxt) < 0)
-		{
-			return;
-		}
-
-		int n = rcv_buf.Length - 1;
-		int after_idx = -1;
-		bool repeat = false;
-		for (int i = n; i >= 0; i--)
-		{
-			Segment seg = rcv_buf[i];
-			if (seg.sn == sn)
-			{
-				repeat = true;
-				break;
-			}
-
-			if (_itimediff(sn, seg.sn) > 0)
-			{
-				after_idx = i;
-				break;
-			}
-		}
-
-		if (!repeat)
-		{
-			if (after_idx == -1)
-			{
-				this.rcv_buf = append(new Segment[1] { newseg }, this.rcv_buf);
-			}
-			else
-			{
-				this.rcv_buf = append(slice(this.rcv_buf, 0, after_idx + 1),
-				                      append(new Segment[1] { newseg }, slice(this.rcv_buf, after_idx + 1, this.rcv_buf.Length)));
-			}
-		}
-
-		// move available data from rcv_buf -> rcv_queue
-		int count = 0;
-		foreach (Segment seg in rcv_buf)
-		{
-			if (seg.sn == this.rcv_nxt && this.rcv_queue.Length < this.rcv_wnd)
-			{
-				this.rcv_queue = append(this.rcv_queue, seg);
-				this.rcv_nxt++;
-				count++;
-			}
-			else
-			{
-				break;
-			}
-		}
-
-		if (0 < count)
-		{
-			this.rcv_buf = slice(this.rcv_buf, count, this.rcv_buf.Length);
-		}
-	}
-
-	// when you received a low level packet (eg. UDP packet), call it
-	public int Input(byte[] data)
-	{
-		uint s_una = snd_una;
-		if (data.Length < IKCP_OVERHEAD)
-		{
-			return 0;
-		}
-
-		int offset = 0;
-
-		while (true)
-		{
-			UInt32 ts = 0;
-			UInt32 sn = 0;
-			UInt32 length = 0;
-			UInt32 una = 0;
-			UInt32 conv_ = 0;
-
-			UInt16 wnd = 0;
-
-			byte cmd = 0;
-			byte frg = 0;
-
-			if (data.Length - offset < IKCP_OVERHEAD)
-			{
-				break;
-			}
-
-			offset += ikcp_decode32u(data, offset, ref conv_);
-
-			// 这里我做了修改,不判断两端kcp conv相等,因为客户端也需要一个socket支持多个client连接
-			//if (conv != conv_)
-			//	return -1;
-
-			offset += ikcp_decode8u(data, offset, ref cmd);
-			offset += ikcp_decode8u(data, offset, ref frg);
-			offset += ikcp_decode16u(data, offset, ref wnd);
-			offset += ikcp_decode32u(data, offset, ref ts);
-			offset += ikcp_decode32u(data, offset, ref sn);
-			offset += ikcp_decode32u(data, offset, ref una);
-			offset += ikcp_decode32u(data, offset, ref length);
-
-			if (data.Length - offset < length)
-			{
-				return -2;
-			}
-
-			switch (cmd)
-			{
-				case IKCP_CMD_PUSH:
-				case IKCP_CMD_ACK:
-				case IKCP_CMD_WASK:
-				case IKCP_CMD_WINS:
-					break;
-				default:
-					return -3;
-			}
-
-			rmt_wnd = wnd;
-			parse_una(una);
-			shrink_buf();
-
-			if (IKCP_CMD_ACK == cmd)
-			{
-				if (_itimediff(current, ts) >= 0)
-				{
-					this.update_ack(_itimediff(this.current, ts));
-				}
-
-				parse_ack(sn);
-				shrink_buf();
-			}
-			else if (IKCP_CMD_PUSH == cmd)
-			{
-				if (_itimediff(sn, rcv_nxt + rcv_wnd) < 0)
-				{
-					ack_push(sn, ts);
-					if (_itimediff(sn, rcv_nxt) >= 0)
-					{
-						Segment seg = new Segment((int)length);
-						seg.conv = conv_;
-						seg.cmd = cmd;
-						seg.frg = frg;
-						seg.wnd = wnd;
-						seg.ts = ts;
-						seg.sn = sn;
-						seg.una = una;
-
-						if (length > 0)
-						{
-							Array.Copy(data, offset, seg.data, 0, length);
-						}
-
-						parse_data(seg);
-					}
-				}
-			}
-			else if (IKCP_CMD_WASK == cmd)
-			{
-				// ready to send back IKCP_CMD_WINS in Ikcp_flush
-				// tell remote my window size
-				probe |= IKCP_ASK_TELL;
-			}
-			else if (IKCP_CMD_WINS == cmd)
-			{
-				// do nothing
-			}
-			else
-			{
-				return -3;
-			}
-
-			offset += (int)length;
-		}
-
-		if (_itimediff(snd_una, s_una) > 0)
-		{
-			if (this.cwnd < this.rmt_wnd)
-			{
-				uint mss_ = this.mss;
-				if (this.cwnd < this.ssthresh)
-				{
-					this.cwnd++;
-					this.incr += mss_;
-				}
-				else
-				{
-					if (this.incr < mss_)
-					{
-						this.incr = mss_;
-					}
-
-					this.incr += mss_ * mss_ / this.incr + mss_ / 16;
-					if ((this.cwnd + 1) * mss_ <= this.incr)
-					{
-						this.cwnd++;
-					}
-				}
-				if (this.cwnd > this.rmt_wnd)
-				{
-					this.cwnd = this.rmt_wnd;
-					this.incr = this.rmt_wnd * mss_;
-				}
-			}
-		}
-
-		return 0;
-	}
-
-	private Int32 wnd_unused()
-	{
-		if (rcv_queue.Length < rcv_wnd)
-		{
-			return (int)this.rcv_wnd - this.rcv_queue.Length;
-		}
-
-		return 0;
-	}
-
-	// flush pending data
-	private void flush()
-	{
-		uint current_ = current;
-		var buffer_ = buffer;
-		int change = 0;
-		int lost = 0;
-
-		if (0 == updated)
-		{
-			return;
-		}
-
-		Segment seg = new Segment(0);
-		seg.conv = conv;
-		seg.cmd = IKCP_CMD_ACK;
-		seg.wnd = (UInt32)wnd_unused();
-		seg.una = rcv_nxt;
-
-		// flush acknowledges
-		int count = acklist.Length / 2;
-		int offset = 0;
-		for (int i = 0; i < count; i++)
-		{
-			if (offset + IKCP_OVERHEAD > mtu)
-			{
-				output(buffer, offset);
-				//Array.Clear(buffer, 0, offset);
-				offset = 0;
-			}
-			ack_get(i, ref seg.sn, ref seg.ts);
-			offset += seg.encode(buffer, offset);
-		}
-		acklist = new UInt32[0];
-
-		// probe window size (if remote window size equals zero)
-		if (0 == rmt_wnd)
-		{
-			if (0 == probe_wait)
-			{
-				probe_wait = IKCP_PROBE_INIT;
-				ts_probe = current + probe_wait;
-			}
-			else
-			{
-				if (_itimediff(current, ts_probe) >= 0)
-				{
-					if (probe_wait < IKCP_PROBE_INIT)
-					{
-						this.probe_wait = IKCP_PROBE_INIT;
-					}
-
-					probe_wait += probe_wait / 2;
-					if (probe_wait > IKCP_PROBE_LIMIT)
-					{
-						this.probe_wait = IKCP_PROBE_LIMIT;
-					}
-
-					ts_probe = current + probe_wait;
-					probe |= IKCP_ASK_SEND;
-				}
-			}
-		}
-		else
-		{
-			ts_probe = 0;
-			probe_wait = 0;
-		}
-
-		// flush window probing commands
-		if ((probe & IKCP_ASK_SEND) != 0)
-		{
-			seg.cmd = IKCP_CMD_WASK;
-			if (offset + IKCP_OVERHEAD > (int)mtu)
-			{
-				output(buffer, offset);
-				//Array.Clear(buffer, 0, offset);
-				offset = 0;
-			}
-			offset += seg.encode(buffer, offset);
-		}
-
-		probe = 0;
-
-		// calculate window size
-		uint cwnd_ = _imin_(snd_wnd, rmt_wnd);
-		if (0 == nocwnd)
-		{
-			cwnd_ = _imin_(this.cwnd, cwnd_);
-		}
-
-		count = 0;
-		for (int k = 0; k < snd_queue.Length; k++)
-		{
-			if (_itimediff(snd_nxt, snd_una + cwnd_) >= 0)
-			{
-				break;
-			}
-
-			Segment newseg = snd_queue[k];
-			newseg.conv = conv;
-			newseg.cmd = IKCP_CMD_PUSH;
-			newseg.wnd = seg.wnd;
-			newseg.ts = current_;
-			newseg.sn = snd_nxt;
-			newseg.una = rcv_nxt;
-			newseg.resendts = current_;
-			newseg.rto = rx_rto;
-			newseg.fastack = 0;
-			newseg.xmit = 0;
-			snd_buf = append(snd_buf, newseg);
-			snd_nxt++;
-			count++;
-		}
-
-		if (0 < count)
-		{
-			this.snd_queue = slice(this.snd_queue, count, this.snd_queue.Length);
-		}
-
-		// calculate resent
-		uint resent = (UInt32)fastresend;
-		if (fastresend <= 0)
-		{
-			resent = 0xffffffff;
-		}
-
-		uint rtomin = rx_rto >> 3;
-		if (nodelay != 0)
-		{
-			rtomin = 0;
-		}
-
-		// flush data segments
-		foreach (Segment segment in snd_buf)
-		{
-			bool needsend = false;
-			int debug = _itimediff(current_, segment.resendts);
-			if (0 == segment.xmit)
-			{
-				needsend = true;
-				segment.xmit++;
-				segment.rto = rx_rto;
-				segment.resendts = current_ + segment.rto + rtomin;
-			}
-			else if (_itimediff(current_, segment.resendts) >= 0)
-			{
-				needsend = true;
-				segment.xmit++;
-				xmit++;
-				if (0 == nodelay)
-				{
-					segment.rto += this.rx_rto;
-				}
-				else
-				{
-					segment.rto += this.rx_rto / 2;
-				}
-
-				segment.resendts = current_ + segment.rto;
-				lost = 1;
-			}
-			else if (segment.fastack >= resent)
-			{
-				needsend = true;
-				segment.xmit++;
-				segment.fastack = 0;
-				segment.resendts = current_ + segment.rto;
-				change++;
-			}
-
-			if (needsend)
-			{
-				segment.ts = current_;
-				segment.wnd = seg.wnd;
-				segment.una = rcv_nxt;
-
-				int need = IKCP_OVERHEAD + segment.data.Length;
-				if (offset + need > mtu)
-				{
-					output(buffer, offset);
-					//Array.Clear(buffer, 0, offset);
-					offset = 0;
-				}
-
-				offset += segment.encode(buffer, offset);
-				if (segment.data.Length > 0)
-				{
-					Array.Copy(segment.data, 0, buffer, offset, segment.data.Length);
-					offset += segment.data.Length;
-				}
-
-				if (segment.xmit >= dead_link)
-				{
-					this.state = 0;
-				}
-			}
-		}
-
-		// flash remain segments
-		if (offset > 0)
-		{
-			output(buffer, offset);
-			//Array.Clear(buffer, 0, offset);
-			offset = 0;
-		}
-
-		// update ssthresh
-		if (change != 0)
-		{
-			uint inflight = snd_nxt - snd_una;
-			ssthresh = inflight / 2;
-			if (ssthresh < IKCP_THRESH_MIN)
-			{
-				this.ssthresh = IKCP_THRESH_MIN;
-			}
-
-			cwnd = ssthresh + resent;
-			incr = cwnd * mss;
-		}
-
-		if (lost != 0)
-		{
-			ssthresh = cwnd / 2;
-			if (ssthresh < IKCP_THRESH_MIN)
-			{
-				this.ssthresh = IKCP_THRESH_MIN;
-			}
-
-			cwnd = 1;
-			incr = mss;
-		}
-
-		if (cwnd < 1)
-		{
-			cwnd = 1;
-			incr = mss;
-		}
-	}
-
-	// update state (call it repeatedly, every 10ms-100ms), or you can ask
-	// ikcp_check when to call it again (without ikcp_input/_send calling).
-	// 'current' - current timestamp in millisec.
-	public void Update(UInt32 current_)
-	{
-		current = current_;
-
-		if (0 == updated)
-		{
-			updated = 1;
-			ts_flush = current;
-		}
-
-		int slap = _itimediff(current, ts_flush);
-
-		if (slap >= 10000 || slap < -10000)
-		{
-			ts_flush = current;
-			slap = 0;
-		}
-
-		if (slap >= 0)
-		{
-			ts_flush += interval;
-			if (_itimediff(current, ts_flush) >= 0)
-			{
-				this.ts_flush = this.current + this.interval;
-			}
-
-			flush();
-		}
-	}
-
-	// Determine when should you invoke ikcp_update:
-	// returns when you should invoke ikcp_update in millisec, if there
-	// is no ikcp_input/_send calling. you can call ikcp_update in that
-	// time, instead of call update repeatly.
-	// Important to reduce unnacessary ikcp_update invoking. use it to
-	// schedule ikcp_update (eg. implementing an epoll-like mechanism,
-	// or optimize ikcp_update when handling massive kcp connections)
-	public UInt32 Check(UInt32 current_)
-	{
-		if (0 == updated)
-		{
-			return current_;
-		}
-
-		uint ts_flush_ = ts_flush;
-		int tm_flush_ = 0x7fffffff;
-		int tm_packet = 0x7fffffff;
-		int minimal = 0;
-
-		if (_itimediff(current_, ts_flush_) >= 10000 || _itimediff(current_, ts_flush_) < -10000)
-		{
-			ts_flush_ = current_;
-		}
-
-		if (_itimediff(current_, ts_flush_) >= 0)
-		{
-			return current_;
-		}
-
-		tm_flush_ = _itimediff(ts_flush_, current_);
-
-		foreach (Segment seg in snd_buf)
-		{
-			int diff = _itimediff(seg.resendts, current_);
-			if (diff <= 0)
-			{
-				return current_;
-			}
-
-			if (diff < tm_packet)
-			{
-				tm_packet = diff;
-			}
-		}
-
-		minimal = tm_packet;
-		if (tm_packet >= tm_flush_)
-		{
-			minimal = tm_flush_;
-		}
-
-		if (minimal >= interval)
-		{
-			minimal = (int)this.interval;
-		}
-
-		return current_ + (UInt32)minimal;
-	}
-
-	// change MTU size, default is 1400
-	public int SetMtu(Int32 mtu_)
-	{
-		if (mtu_ < 50 || mtu_ < IKCP_OVERHEAD)
-		{
-			return -1;
-		}
-
-		var buffer_ = new byte[(mtu_ + IKCP_OVERHEAD) * 3];
-		if (null == buffer_)
-		{
-			return -2;
-		}
-
-		mtu = (UInt32)mtu_;
-		mss = mtu - IKCP_OVERHEAD;
-		buffer = buffer_;
-		return 0;
-	}
-
-	public int Interval(Int32 interval_)
-	{
-		if (interval_ > 5000)
-		{
-			interval_ = 5000;
-		}
-		else if (interval_ < 10)
-		{
-			interval_ = 10;
-		}
-
-		interval = (UInt32)interval_;
-		return 0;
-	}
-
-	// fastest: ikcp_nodelay(kcp, 1, 20, 2, 1)
-	// nodelay: 0:disable(default), 1:enable
-	// interval: internal update timer interval in millisec, default is 100ms
-	// resend: 0:disable fast resend(default), 1:enable fast resend
-	// nc: 0:normal congestion control(default), 1:disable congestion control
-	public int NoDelay(int nodelay_, int interval_, int resend_, int nc_)
-	{
-		if (nodelay_ > 0)
-		{
-			nodelay = (UInt32)nodelay_;
-			if (nodelay_ != 0)
-			{
-				this.rx_minrto = IKCP_RTO_NDL;
-			}
-			else
-			{
-				this.rx_minrto = IKCP_RTO_MIN;
-			}
-		}
-
-		if (interval_ >= 0)
-		{
-			if (interval_ > 5000)
-			{
-				interval_ = 5000;
-			}
-			else if (interval_ < 10)
-			{
-				interval_ = 10;
-			}
-
-			interval = (UInt32)interval_;
-		}
-
-		if (resend_ >= 0)
-		{
-			this.fastresend = resend_;
-		}
-
-		if (nc_ >= 0)
-		{
-			this.nocwnd = nc_;
-		}
-
-		return 0;
-	}
-
-	// set maximum window size: sndwnd=32, rcvwnd=32 by default
-	public int WndSize(int sndwnd, int rcvwnd)
-	{
-		if (sndwnd > 0)
-		{
-			this.snd_wnd = (UInt32)sndwnd;
-		}
-
-		if (rcvwnd > 0)
-		{
-			this.rcv_wnd = (UInt32)rcvwnd;
-		}
-
-		return 0;
-	}
-
-	// get how many packet is waiting to be sent
-	public int WaitSnd()
-	{
-		return snd_buf.Length + snd_queue.Length;
-	}
-}
+    public class KCP
+    {
+        public const int IKCP_RTO_NDL = 30;         // no delay min rto
+        public const int IKCP_RTO_MIN = 100;        // normal min rto
+        public const int IKCP_RTO_DEF = 200;
+        public const int IKCP_RTO_MAX = 60000;
+        public const int IKCP_CMD_PUSH = 81;        // cmd: push data
+        public const int IKCP_CMD_ACK = 82;         // cmd: ack
+        public const int IKCP_CMD_WASK = 83;        // cmd: window probe (ask)
+        public const int IKCP_CMD_WINS = 84;        // cmd: window size (tell)
+        public const int IKCP_ASK_SEND = 1;         // need to send IKCP_CMD_WASK
+        public const int IKCP_ASK_TELL = 2;         // need to send IKCP_CMD_WINS
+        public const int IKCP_WND_SND = 32;
+        public const int IKCP_WND_RCV = 32;
+        public const int IKCP_MTU_DEF = 1400;
+        public const int IKCP_ACK_FAST = 3;
+        public const int IKCP_INTERVAL = 100;
+        public const int IKCP_OVERHEAD = 24;
+        public const int IKCP_DEADLINK = 20;
+        public const int IKCP_THRESH_INIT = 2;
+        public const int IKCP_THRESH_MIN = 2;
+        public const int IKCP_PROBE_INIT = 7000;    // 7 secs to probe window size
+        public const int IKCP_PROBE_LIMIT = 120000; // up to 120 secs to probe window
+
+        public const int IKCP_LOG_OUTPUT = 0x1;
+        public const int IKCP_LOG_INPUT = 0x2;
+        public const int IKCP_LOG_SEND = 0x4;
+        public const int IKCP_LOG_RECV = 0x8;
+        public const int IKCP_LOG_IN_DATA = 0x10;
+        public const int IKCP_LOG_IN_ACK = 0x20;
+        public const int IKCP_LOG_IN_PROBE = 0x40;
+        public const int IKCP_LOG_IN_WINS = 0x80;
+        public const int IKCP_LOG_OUT_DATA = 0x100;
+        public const int IKCP_LOG_OUT_ACK = 0x200;
+        public const int IKCP_LOG_OUT_PROBE = 0x400;
+        public const int IKCP_LOG_OUT_WINS = 0x800;
+
+
+        // encode 8 bits unsigned int
+        public static void ikcp_encode8u(byte[] p, int offset, byte c)
+        {
+            p[offset] = c;
+        }
+
+        // decode 8 bits unsigned int
+        public static byte ikcp_decode8u(byte[] p, ref int offset)
+        {
+            return p[offset++];
+        }
+
+        // encode 16 bits unsigned int (lsb)
+        public static void ikcp_encode16u(byte[] p, int offset, ushort v)
+        {
+            p[offset] = (byte)(v & 0xFF);
+            p[offset + 1] = (byte)(v >> 8);
+        }
+
+        // decode 16 bits unsigned int (lsb)
+        public static ushort ikcp_decode16u(byte[] p, ref int offset)
+        {
+            int pos = offset;
+            offset += 2;
+            return (ushort)((ushort)p[pos] | (ushort)(p[pos + 1] << 8));
+        }
+
+        // encode 32 bits unsigned int (lsb)
+        public static void ikcp_encode32u(byte[] p, int offset, uint l)
+        {
+            p[offset] = (byte)(l & 0xFF);
+            p[offset + 1] = (byte)(l >> 8);
+            p[offset + 2] = (byte)(l >> 16);
+            p[offset + 3] = (byte)(l >> 24);
+        }
+
+        // decode 32 bits unsigned int (lsb)
+        public static uint ikcp_decode32u(byte[] p, ref int offset)
+        {
+            int pos = offset;
+            offset += 4;
+            return ((uint)p[pos] | (uint)(p[pos + 1] << 8)
+                | (uint)(p[pos + 2] << 16) | (uint)(p[pos + 3] << 24));
+        }
+
+        public static uint _imin_(uint a, uint b)
+        {
+            return a <= b ? a : b;
+        }
+
+        public static uint _imax_(uint a, uint b)
+        {
+            return a >= b ? a : b;
+        }
+
+        public static uint _ibound_(uint lower, uint middle, uint upper)
+        {
+            return _imin_(_imax_(lower, middle), upper);
+        }
+
+        public static int _itimediff(uint later, uint earlier)
+        {
+            return (int)(later - earlier);
+        }
+
+        internal class Segment: IDisposable
+        {
+            internal uint conv;
+            internal uint cmd;
+            internal uint frg;
+            internal uint wnd;
+            internal uint ts;
+            internal uint sn;
+            internal uint una;
+            internal uint resendts;
+            internal uint rto;
+            internal uint faskack;
+            internal uint xmit;
+            internal byte[] data { get; }
+
+            internal Segment(int size = 0)
+            {
+                data = new byte[size];
+            }
+
+            internal void Encode(byte[] ptr, ref int offset)
+            {
+                uint len = (uint)data.Length;
+                ikcp_encode32u(ptr, offset, conv);
+                ikcp_encode8u(ptr, offset + 4, (byte)cmd);
+                ikcp_encode8u(ptr, offset + 5, (byte)frg);
+                ikcp_encode16u(ptr, offset + 6, (ushort)wnd);
+                ikcp_encode32u(ptr, offset + 8, ts);
+                ikcp_encode32u(ptr, offset + 12, sn);
+                ikcp_encode32u(ptr, offset + 16, una);
+                ikcp_encode32u(ptr, offset + 20, len);
+                offset += IKCP_OVERHEAD;
+            }
+
+            public void Dispose()
+            {
+                this.conv = 0;
+                this.cmd = 0;
+                this.frg = 0;
+                this.wnd = 0;
+                this.ts = 0;
+                this.sn = 0;
+                this.una = 0;
+                this.resendts = 0;
+                this.rto = 0;
+                this.faskack = 0;
+                this.xmit = 0;
+            }
+        }
+
+        uint conv_;
+        uint mtu_;
+        uint mss_;
+        uint state_;
+
+        uint snd_una_;
+        uint snd_nxt_;
+        uint rcv_nxt_;
+
+        uint ts_recent_ = 0;
+        uint ts_lastack_ = 0;
+        uint ssthresh_;
+
+        int rx_rttval_;
+        int rx_srtt_;
+        int rx_rto_;
+        int rx_minrto_;
+
+        uint snd_wnd_;
+        uint rcv_wnd_;
+        uint rmt_wnd_;
+        uint cwnd_;
+        uint probe_;
+
+        uint current_;
+        uint interval_;
+        uint ts_flush_;
+        uint xmit_;
+
+        uint nrcv_buf_;
+        uint nsnd_buf_;
+        uint nrcv_que_;
+        uint nsnd_que_;
+
+        uint nodelay_;
+        uint updated_;
+        uint ts_probe_;
+        uint probe_wait_;
+        uint dead_link_;
+        uint incr_;
+
+        LinkedList<Segment> snd_queue_;
+        LinkedList<Segment> rcv_queue_;
+        LinkedList<Segment> snd_buf_;
+        LinkedList<Segment> rcv_buf_;
+
+        uint[] acklist_;
+        uint ackcount_;
+        uint ackblock_;
+
+        byte[] buffer_;
+        object user_;
+
+        int fastresend_;
+        int nocwnd_;
+
+        public delegate void OutputDelegate(byte[] data, int size, object user);
+        OutputDelegate output_;
+
+        // create a new kcp control object, 'conv' must equal in two endpoint
+        // from the same connection. 'user' will be passed to the output callback
+        // output callback can be setup like this: 'kcp->output = my_udp_output'
+        public KCP(uint conv, object user)
+        {
+            Debug.Assert(BitConverter.IsLittleEndian); // we only support little endian device
+
+            user_ = user;
+            conv_ = conv;
+            snd_wnd_ = IKCP_WND_SND;
+            rcv_wnd_ = IKCP_WND_RCV;
+            rmt_wnd_ = IKCP_WND_RCV;
+            mtu_ = IKCP_MTU_DEF;
+            mss_ = mtu_ - IKCP_OVERHEAD;
+            rx_rto_ = IKCP_RTO_DEF;
+            rx_minrto_ = IKCP_RTO_MIN;
+            interval_ = IKCP_INTERVAL;
+            ts_flush_ = IKCP_INTERVAL;
+            ssthresh_ = IKCP_THRESH_INIT;
+            dead_link_ = IKCP_DEADLINK;
+            buffer_ = new byte[(mtu_ + IKCP_OVERHEAD) * 3];
+            snd_queue_ = new LinkedList<Segment>();
+            rcv_queue_ = new LinkedList<Segment>();
+            snd_buf_ = new LinkedList<Segment>();
+            rcv_buf_ = new LinkedList<Segment>();
+        }
+
+        // release kcp control object
+        public void Release()
+        {
+            snd_buf_.Clear();
+            rcv_buf_.Clear();
+            snd_queue_.Clear();
+            rcv_queue_.Clear();
+            nrcv_buf_ = 0;
+            nsnd_buf_ = 0;
+            nrcv_que_ = 0;
+            nsnd_que_ = 0;
+            ackblock_ = 0;
+            ackcount_ = 0;
+            buffer_ = null;
+            acklist_ = null;
+        }
+
+        // set output callback, which will be invoked by kcp
+        public void SetOutput(OutputDelegate output)
+        {
+            output_ = output;
+        }
+
+        // user/upper level recv: returns size, returns below zero for EAGAIN
+        public int Recv(byte[] buffer, int offset, int len)
+        {
+            int ispeek = (len < 0 ? 1 : 0);
+            int recover = 0;
+
+            if (rcv_queue_.Count == 0)
+                return -1;
+
+            if (len < 0)
+                len = -len;
+
+            int peeksize = PeekSize();
+            if (peeksize < 0)
+                return -2;
+
+            if (peeksize > len)
+                return -3;
+
+            if (nrcv_que_ >= rcv_wnd_)
+                recover = 1;
+
+            // merge fragment
+            len = 0;
+            LinkedListNode<Segment> next = null;
+            for (var node = rcv_queue_.First; node != null; node = next)
+            {
+                int fragment = 0;
+                var seg = node.Value;
+                next = node.Next;
+                
+                if (buffer != null)
+                {
+                    Buffer.BlockCopy(seg.data, 0, buffer, offset, seg.data.Length);
+                    offset += seg.data.Length;
+                }
+                len += seg.data.Length;
+                fragment = (int)seg.frg;
+
+                Log(IKCP_LOG_RECV, "recv sn={0}", seg.sn);
+
+                if (ispeek == 0)
+                {
+                    rcv_queue_.Remove(node);
+                    nrcv_que_--;
+                }
+
+                if (fragment == 0)
+                    break;
+            }
+
+            Debug.Assert(len == peeksize);
+
+            // move available data from rcv_buf -> rcv_queue
+            while (rcv_buf_.Count > 0)
+            {
+                var node = rcv_buf_.First;
+                var seg = node.Value;
+                if (seg.sn == rcv_nxt_ && nrcv_que_ < rcv_wnd_)
+                {
+                    rcv_buf_.Remove(node);
+                    nrcv_buf_--;
+                    rcv_queue_.AddLast(node);
+                    nrcv_que_++;
+                    rcv_nxt_++;
+                }
+                else
+                {
+                    break;
+                }
+            }
+
+            // fast recover
+            if (nrcv_que_ < rcv_wnd_ && recover != 0)
+            {
+                // ready to send back IKCP_CMD_WINS in ikcp_flush
+                // tell remote my window size
+                probe_ |= IKCP_ASK_TELL;
+            }
+
+            return len;
+        }
+
+        // check the size of next message in the recv queue
+        public int PeekSize()
+        {
+            if (rcv_queue_.Count == 0)
+                return -1;
+
+            var node = rcv_queue_.First;
+            var seg = node.Value;
+            if (seg.frg == 0)
+                return seg.data.Length;
+
+            if (nrcv_que_ < seg.frg + 1)
+                return -1;
+
+            int length = 0;
+            for (node = rcv_queue_.First; node != null; node = node.Next)
+            {
+                seg = node.Value;
+                length += seg.data.Length;
+                if (seg.frg == 0)
+                    break;
+            }
+            return length;
+        }
+
+        // user/upper level send, returns below zero for error
+        public int Send(byte[] buffer, int offset, int len)
+        {
+            Debug.Assert(mss_ > 0);
+            if (len < 0)
+                return -1;
+
+            //
+            // not implement streaming mode here as ikcp.c
+            //
+
+            int count = 0;
+            if (len <= (int)mss_)
+                count = 1;
+            else
+                count = (len + (int)mss_ - 1) / (int)mss_;
+
+            if (count > 255) // maximum value `frg` can present
+                return -2;
+
+            if (count == 0)
+                count = 1;
+
+            // fragment
+            for (int i = 0; i < count; i++)
+            {
+                int size = len > (int)mss_ ? (int)mss_ : len;
+                var seg = new Segment(size);
+                if (buffer != null && len > 0)
+                {
+                    Buffer.BlockCopy(buffer, offset, seg.data, 0, size);
+                    offset += size;
+                }
+                seg.frg = (uint)(count - i - 1);
+                snd_queue_.AddLast(seg);
+                nsnd_que_++;
+                len -= size;
+            }
+            return 0;
+        }
+
+        // parse ack
+        void UpdateACK(int rtt)
+        {
+            if (rx_srtt_ == 0)
+            {
+                rx_srtt_ = rtt;
+                rx_rttval_ = rtt / 2;
+            }
+            else
+            {
+                int delta = rtt - rx_srtt_;
+                if (delta < 0)
+                    delta = -delta;
+
+                rx_rttval_ = (3 * rx_rttval_ + delta) / 4;
+                rx_srtt_ = (7 * rx_srtt_ + rtt) / 8;
+                if (rx_srtt_ < 1)
+                    rx_srtt_ = 1;
+            }
+
+            var rto = rx_srtt_ + _imax_(interval_, (uint)(4 * rx_rttval_));
+            rx_rto_ = (int)_ibound_((uint)rx_minrto_, (uint)rto, IKCP_RTO_MAX);
+        }
+
+        void ShrinkBuf()
+        {
+            var node = snd_buf_.First;
+            if (node != null)
+            {
+                var seg = node.Value;
+                snd_una_ = seg.sn;
+            }
+            else
+            {
+                snd_una_ = snd_nxt_;
+            }
+        }
+
+        void ParseACK(uint sn)
+        {
+            if (_itimediff(sn, snd_una_) < 0 || _itimediff(sn, snd_nxt_) >= 0)
+                return;
+
+            LinkedListNode<Segment> next = null;
+            for (var node = snd_buf_.First; node != null; node = next)
+            {
+                var seg = node.Value;
+                next = node.Next;
+                if (sn == seg.sn)
+                {
+                    snd_buf_.Remove(node);
+                    nsnd_buf_--;
+                    break;
+                }
+                if (_itimediff(sn, seg.sn) < 0)
+                    break;
+            }
+        }
+
+        void ParseUNA(uint una)
+        {
+            LinkedListNode<Segment> next = null;
+            for (var node = snd_buf_.First; node != null; node = next)
+            {
+                var seg = node.Value;
+                next = node.Next;
+                if (_itimediff(una, seg.sn) > 0)
+                {
+                    snd_buf_.Remove(node);
+                    nsnd_buf_--;
+                }
+                else
+                {
+                    break;
+                }
+            }
+        }
+
+        void ParseFastACK(uint sn)
+        {
+            if (_itimediff(sn, snd_una_) < 0 || _itimediff(sn, snd_nxt_) >= 0)
+                return;
+
+            LinkedListNode<Segment> next = null;
+            for (var node = snd_buf_.First; node != null; node = next)
+            {
+                var seg = node.Value;
+                next = node.Next;
+                if (_itimediff(sn, seg.sn) < 0)
+                {
+                    break;
+                }
+                else if (sn != seg.sn)
+                {
+                    seg.faskack++;
+                }
+            }
+        }
+
+        // ack append
+        void ACKPush(uint sn, uint ts)
+        {
+            var newsize = ackcount_ + 1;
+            if (newsize > ackblock_)
+            {
+                uint newblock = 8;
+                for (; newblock < newsize; newblock <<= 1)
+                    ;
+
+                var acklist = new uint[newblock * 2];
+                if (acklist_ != null)
+                {
+                    for (var i = 0; i < ackcount_; i++)
+                    {
+                        acklist[i * 2] = acklist_[i * 2];
+                        acklist[i * 2 + 1] = acklist_[i * 2 + 1];
+                    }
+                }
+                acklist_ = acklist;
+                ackblock_ = newblock;
+            }
+            acklist_[ackcount_ * 2] = sn;
+            acklist_[ackcount_ * 2 + 1] = ts;
+            ackcount_++;
+        }
+
+        void ACKGet(int pos, ref uint sn, ref uint ts)
+        {
+            sn = acklist_[pos * 2];
+            ts = acklist_[pos * 2 + 1];
+        }
+
+        // parse data
+        void ParseData(Segment newseg)
+        {
+            uint sn = newseg.sn;
+            int repeat = 0;
+
+            if (_itimediff(sn, rcv_nxt_ + rcv_wnd_) >= 0 ||
+                _itimediff(sn, rcv_nxt_) < 0)
+            {
+                return;
+            }
+
+            LinkedListNode<Segment> node = null;
+            LinkedListNode<Segment> prev = null;
+            for (node = rcv_buf_.Last; node != null; node = prev)
+            {
+                var seg = node.Value;
+                prev = node.Previous;
+                if (seg.sn == sn)
+                {
+                    repeat = 1;
+                    break;
+                }
+                if (_itimediff(sn, seg.sn) > 0) 
+                {
+                    break;
+                }
+            }
+            if (repeat == 0)
+            {
+                if (node != null)
+                {
+                    rcv_buf_.AddAfter(node, newseg);
+                }
+                else
+                {
+                    rcv_buf_.AddFirst(newseg);
+                }
+                nrcv_buf_++;
+            }
+
+            // move available data from rcv_buf -> rcv_queue
+            while (rcv_buf_.Count > 0)
+            {
+                node = rcv_buf_.First;
+                var seg = node.Value;
+                if (seg.sn == rcv_nxt_ && nrcv_que_ < rcv_wnd_)
+                {
+                    rcv_buf_.Remove(node);
+                    nrcv_buf_--;
+                    rcv_queue_.AddLast(node);
+                    nrcv_que_++;
+                    rcv_nxt_++;
+                }
+                else
+                {
+                    break;
+                }
+            }
+        }
+
+        // when you received a low level packet (eg. UDP packet), call it
+        public int Input(byte[] data, int offset, int size)
+        {
+            uint maxack = 0;
+            int flag = 0;
+
+            Log(IKCP_LOG_INPUT, "[RI] {0} bytes", size);
+
+            if (data == null || size < IKCP_OVERHEAD)
+                return -1;
+
+            while (true)
+            {
+                if (size < IKCP_OVERHEAD)
+                    break;
+
+                uint conv = ikcp_decode32u(data, ref offset);
+                //if (conv_ != conv)
+                //    return -1;
+                uint cmd = ikcp_decode8u(data, ref offset);
+                uint frg = ikcp_decode8u(data, ref offset);
+                uint wnd = ikcp_decode16u(data, ref offset);
+                uint ts = ikcp_decode32u(data, ref offset);
+                uint sn = ikcp_decode32u(data, ref offset);
+                uint una = ikcp_decode32u(data, ref offset);
+                uint len = ikcp_decode32u(data, ref offset);
+
+                size -= IKCP_OVERHEAD;
+                if (size < len)
+                    return -2;
+
+                if (cmd != IKCP_CMD_PUSH && cmd != IKCP_CMD_ACK &&
+                    cmd != IKCP_CMD_WASK && cmd != IKCP_CMD_WINS)
+                    return -3;
+
+                rmt_wnd_ = wnd;
+                ParseUNA(una);
+                ShrinkBuf();
+
+                if (cmd == IKCP_CMD_ACK)
+                {
+                    if (_itimediff(current_, ts) >= 0)
+                    {
+                        UpdateACK(_itimediff(current_, ts));
+                    }
+                    ParseACK(sn);
+                    ShrinkBuf();
+                    if (flag == 0)
+                    {
+                        flag = 1;
+                        maxack = sn;
+                    }
+                    else
+                    {
+                        if (_itimediff(sn, maxack) > 0)
+                        {
+                            maxack = sn;
+                        }
+                    }
+                    Log(IKCP_LOG_IN_DATA, "input ack: sn={0} rtt={1} rto={2}",
+                        sn, _itimediff(current_, ts), rx_rto_);
+                }
+                else if (cmd == IKCP_CMD_PUSH)
+                {
+                    Log(IKCP_LOG_IN_DATA, "input psh: sn={0} ts={1}", sn, ts);
+                    if (_itimediff(sn, rcv_nxt_ + rcv_wnd_) < 0)
+                    {
+                        ACKPush(sn, ts);
+                        if (_itimediff(sn, rcv_nxt_) >= 0)
+                        {
+                            var seg = new Segment((int)len);
+                            seg.conv = conv;
+                            seg.cmd = cmd;
+                            seg.frg = frg;
+                            seg.wnd = wnd;
+                            seg.ts = ts;
+                            seg.sn = sn;
+                            seg.una = una;
+                            if (len > 0)
+                            {
+                                Buffer.BlockCopy(data, offset, seg.data, 0, (int)len);
+                            }
+                            ParseData(seg);
+                        }
+                    }
+                }
+                else if (cmd == IKCP_CMD_WASK)
+                {
+                    // ready to send back IKCP_CMD_WINS in ikcp_flush
+                    // tell remote my window size
+                    probe_ |= IKCP_ASK_TELL;
+                    Log(IKCP_LOG_IN_PROBE, "input probe");
+                }
+                else if (cmd == IKCP_CMD_WINS)
+                {
+                    // do nothing
+                    Log(IKCP_LOG_IN_WINS, "input wins: {0}", wnd);
+                }
+                else
+                {
+                    return -3;
+                }
+
+                offset += (int)len;
+                size -= (int)len;
+            }
+
+            if (flag != 0)
+            {
+                ParseFastACK(maxack);
+            }
+
+            uint unack = snd_una_;
+            if (_itimediff(snd_una_, unack) > 0)
+            {
+                if (cwnd_ < rmt_wnd_)
+                {
+                    if (cwnd_ < ssthresh_)
+                    {
+                        cwnd_++;
+                        incr_ += mss_;
+                    }
+                    else
+                    {
+                        if (incr_ < mss_)
+                            incr_ = mss_;
+                        incr_ += (mss_ * mss_) / incr_ + (mss_ / 16);
+                        if ((cwnd_ + 1) * mss_ <= incr_)
+                            cwnd_++;
+                    }
+                    if (cwnd_ > rmt_wnd_)
+                    {
+                        cwnd_ = rmt_wnd_;
+                        incr_ = rmt_wnd_ * mss_;
+                    }
+                }
+            }
+
+            return 0;
+        }
+
+        int WndUnused()
+        {
+            if (nrcv_que_ < rcv_wnd_)
+                return (int)(rcv_wnd_ - nrcv_que_);
+            return 0;
+        }
+
+        // flush pending data
+        void Flush()
+        {
+            int change = 0;
+            int lost = 0;
+            int offset = 0;
+
+            // 'ikcp_update' haven't been called. 
+            if (updated_ == 0)
+                return;
+
+            var seg = new Segment
+            {
+                conv = conv_,
+                cmd = IKCP_CMD_ACK,
+                wnd = (uint)WndUnused(),
+                una = rcv_nxt_,
+            };
+
+            // flush acknowledges
+            int count = (int)ackcount_;
+            for (int i = 0; i < count; i++)
+            {
+                if ((offset + IKCP_OVERHEAD) > mtu_)
+                {
+                    output_(buffer_, offset, user_);
+                    offset = 0;
+                }
+                ACKGet(i, ref seg.sn, ref seg.ts);
+                seg.Encode(buffer_, ref offset);
+            }
+
+            ackcount_ = 0;
+
+            // probe window size (if remote window size equals zero)
+            if (rmt_wnd_ == 0)
+            {
+                if (probe_wait_ == 0)
+                {
+                    probe_wait_ = IKCP_PROBE_INIT;
+                    ts_probe_ = current_ + probe_wait_;
+                }
+                else
+                {
+                    if (_itimediff(current_, ts_probe_) >= 0)
+                    {
+                        if (probe_wait_ < IKCP_PROBE_INIT)
+                            probe_wait_ = IKCP_PROBE_INIT;
+                        probe_wait_ += probe_wait_ / 2;
+                        if (probe_wait_ > IKCP_PROBE_LIMIT)
+                            probe_wait_ = IKCP_PROBE_LIMIT;
+                        ts_probe_ = current_ + probe_wait_;
+                        probe_ |= IKCP_ASK_SEND;
+                    }
+                }
+            }
+            else
+            {
+                ts_probe_ = 0;
+                probe_wait_ = 0;
+            }
+
+            // flush window probing commands
+            if ((probe_ & IKCP_ASK_SEND) > 0)
+            {
+                seg.cmd = IKCP_CMD_WASK;
+                if ((offset + IKCP_OVERHEAD) > mtu_)
+                {
+                    output_(buffer_, offset, user_);
+                    offset = 0;
+                }
+                seg.Encode(buffer_, ref offset);
+            }
+
+            // flush window probing commands
+            if ((probe_ & IKCP_ASK_TELL) > 0)
+            {
+                seg.cmd = IKCP_CMD_WINS;
+                if ((offset + IKCP_OVERHEAD) > mtu_)
+                {
+                    output_(buffer_, offset, user_);
+                    offset = 0;
+                }
+                seg.Encode(buffer_, ref offset);
+            }
+
+            probe_ = 0;
+
+            // calculate window size
+            uint cwnd = _imin_(snd_wnd_, rmt_wnd_);
+            if (nocwnd_ == 0)
+                cwnd = _imin_(cwnd_, cwnd);
+
+            // move data from snd_queue to snd_buf
+            while (_itimediff(snd_nxt_, snd_una_ + cwnd) < 0)
+            {
+                if (snd_queue_.Count == 0)
+                    break;
+
+                var node = snd_queue_.First;
+                var newseg = node.Value;
+                snd_queue_.Remove(node);
+                snd_buf_.AddLast(node);
+                nsnd_que_--;
+                nsnd_buf_++;
+
+                newseg.conv = conv_;
+                newseg.cmd = IKCP_CMD_PUSH;
+                newseg.wnd = seg.wnd;
+                newseg.ts = current_;
+                newseg.sn = snd_nxt_++;
+                newseg.una = rcv_nxt_;
+                newseg.resendts = current_;
+                newseg.rto = (uint)rx_rto_;
+                newseg.faskack = 0;
+                newseg.xmit = 0;
+            }
+
+            // calculate resent
+            uint resent = (fastresend_ > 0 ? (uint)fastresend_ : 0xffffffff);
+            uint rtomin = (nodelay_ == 0 ? (uint)(rx_rto_ >> 3) : 0);
+
+            // flush data segments
+            for (var node = snd_buf_.First; node != null; node = node.Next)
+            {
+                var segment = node.Value;
+                int needsend = 0;
+                if (segment.xmit == 0)
+                {
+                    needsend = 1;
+                    segment.xmit++;
+                    segment.rto = (uint)rx_rto_;
+                    segment.resendts = current_ + segment.rto + rtomin;
+                }
+                else if (_itimediff(current_, segment.resendts) >= 0)
+                {
+                    needsend = 1;
+                    segment.xmit++;
+                    xmit_++;
+                    if (nodelay_ == 0)
+                        segment.rto += (uint)rx_rto_;
+                    else
+                        segment.rto += (uint)rx_rto_ / 2;
+                    segment.resendts = current_ + segment.rto;
+                    lost = 1;
+                }
+                else if (segment.faskack >= resent)
+                {
+                    needsend = 1;
+                    segment.xmit++;
+                    segment.faskack = 0;
+                    segment.resendts = current_ + segment.rto;
+                    change++;
+                }
+
+                if (needsend > 0)
+                {
+                    segment.ts = current_;
+                    segment.wnd = seg.wnd;
+                    segment.una = rcv_nxt_;
+
+                    int need = IKCP_OVERHEAD;
+                    if (segment.data != null)
+                        need += segment.data.Length;
+
+                    if (offset + need > mtu_)
+                    {
+                        output_(buffer_, offset, user_);
+                        offset = 0;
+                    }
+                    segment.Encode(buffer_, ref offset);
+                    if (segment.data.Length > 0)
+                    {
+                        Buffer.BlockCopy(segment.data, 0, buffer_, offset, segment.data.Length);
+                        offset += segment.data.Length;
+                    }
+                    if (segment.xmit >= dead_link_)
+                        state_ = 0xffffffff;
+                }
+            }
+
+            // flush remain segments
+            if (offset > 0)
+            {
+                output_(buffer_, offset, user_);
+                offset = 0;
+            }
+
+            // update ssthresh
+            if (change > 0)
+            {
+                uint inflight = snd_nxt_ - snd_una_;
+                ssthresh_ = inflight / 2;
+                if (ssthresh_ < IKCP_THRESH_MIN)
+                    ssthresh_ = IKCP_THRESH_MIN;
+                cwnd_ = ssthresh_ + resent;
+                incr_ = cwnd_ * mss_;
+            }
+
+            if (lost > 0)
+            {
+                ssthresh_ = cwnd / 2;
+                if (ssthresh_ < IKCP_THRESH_MIN)
+                    ssthresh_ = IKCP_THRESH_MIN;
+                cwnd_ = 1;
+                incr_ = mss_;
+            }
+
+            if (cwnd_ < 1)
+            {
+                cwnd_ = 1;
+                incr_ = mss_;
+            }
+        }
+
+        // update state (call it repeatedly, every 10ms-100ms), or you can ask 
+        // ikcp_check when to call it again (without ikcp_input/_send calling).
+        // 'current' - current timestamp in millisec. 
+        public void Update(uint current)
+        {
+            current_ = current;
+            if (updated_ == 0)
+            {
+                updated_ = 1;
+                ts_flush_ = current;
+            }
+
+            int slap = _itimediff(current_, ts_flush_);
+            if (slap >= 10000 || slap < -10000)
+            {
+                ts_flush_ = current;
+                slap = 0;
+            }
+
+            if (slap >= 0)
+            {
+                ts_flush_ += interval_;
+                if (_itimediff(current_, ts_flush_) >= 0)
+                    ts_flush_ = current_ + interval_;
+
+                Flush();
+            }
+        }
+
+        // Determine when should you invoke ikcp_update:
+        // returns when you should invoke ikcp_update in millisec, if there 
+        // is no ikcp_input/_send calling. you can call ikcp_update in that
+        // time, instead of call update repeatly.
+        // Important to reduce unnacessary ikcp_update invoking. use it to 
+        // schedule ikcp_update (eg. implementing an epoll-like mechanism, 
+        // or optimize ikcp_update when handling massive kcp connections)
+        public uint Check(uint current)
+        {
+            uint ts_flush = ts_flush_;
+            int tm_flush = 0x7fffffff;
+            int tm_packet = 0x7fffffff;
+
+            if (updated_ == 0)
+                return current;
+
+            if (_itimediff(current, ts_flush) >= 10000 || 
+                _itimediff(current, ts_flush) < -10000)
+            {
+                ts_flush = current;
+            }
+
+            if (_itimediff(current, ts_flush) >= 0)
+                return current;
+
+            tm_flush = _itimediff(ts_flush, current);
+
+            for (var node = snd_buf_.First; node != null; node = node.Next)
+            {
+                var seg = node.Value;
+                int diff = _itimediff(seg.resendts, current);
+                if (diff <= 0)
+                    return current;
+
+                if (diff < tm_packet)
+                    tm_packet = diff;
+            }
+
+            uint minimal = (uint)(tm_packet < tm_flush ? tm_packet : tm_flush);
+            if (minimal >= interval_)
+                minimal = interval_;
+
+            return current + minimal;
+        }
+
+        // change MTU size, default is 1400
+        public int SetMTU(int mtu)
+        {
+            if (mtu < 50 || mtu < IKCP_OVERHEAD)
+                return -1;
+
+            var buffer = new byte[(mtu + IKCP_OVERHEAD) * 3];
+            mtu_ = (uint)mtu;
+            mss_ = mtu_ - IKCP_OVERHEAD;
+            buffer_ = buffer;
+            return 0;
+        }
+
+        public int Interval(int interval)
+        {
+            if (interval > 5000)
+                interval = 5000;
+            else if (interval < 10)
+                interval = 10;
+
+            interval_ = (uint)interval;
+            return 0;
+        }
+
+        // fastest: ikcp_nodelay(kcp, 1, 20, 2, 1)
+        // nodelay: 0:disable(default), 1:enable
+        // interval: internal update timer interval in millisec, default is 100ms 
+        // resend: 0:disable fast resend(default), 1:enable fast resend
+        // nc: 0:normal congestion control(default), 1:disable congestion control
+        public int NoDelay(int nodelay, int interval, int resend, int nc)
+        {
+            if (nodelay >= 0)
+            {
+                nodelay_ = (uint)nodelay;
+                if (nodelay > 0)
+                {
+                    rx_minrto_ = IKCP_RTO_NDL;
+                }
+                else
+                {
+                    rx_minrto_ = IKCP_RTO_MIN;
+                }
+            }
+            if (interval >= 0)
+            {
+                if (interval > 5000)
+                    interval = 5000;
+                else if (interval < 10)
+                    interval = 10;
+
+                interval_ = (uint)interval;
+            }
+
+            if (resend >= 0)
+                fastresend_ = resend;
+
+            if (nc >= 0)
+                nocwnd_ = nc;
+
+            return 0;
+        }
+
+        // set maximum window size: sndwnd=32, rcvwnd=32 by default
+        public int WndSize(int sndwnd, int rcvwnd)
+        {
+            if (sndwnd > 0)
+                snd_wnd_ = (uint)sndwnd;
+            if (rcvwnd > 0)
+                rcv_wnd_ = (uint)rcvwnd;
+            return 0;
+        }
+
+        // get how many packet is waiting to be sent
+        public int WaitSnd()
+        {
+            return (int)(nsnd_buf_ + nsnd_que_);
+        }
+
+        // read conv
+        public uint GetConv()
+        {
+            return conv_;
+        }
+
+        public uint GetState()
+        {
+            return state_;
+        }
+
+        public void SetMinRTO(int minrto)
+        {
+            rx_minrto_ = minrto;
+        }
+
+        public void SetFastResend(int resend)
+        {
+            fastresend_ = resend;
+        }
+
+        void Log(int mask, string format, params object[] args)
+        {
+            // Console.WriteLine(mask + String.Format(format, args));
+        }
+    }
+}

+ 21 - 11
Unity/Assets/Scripts/Module/Message/Network/TCP/PacketParser.cs

@@ -2,12 +2,12 @@
 
 namespace ETModel
 {
-	internal enum ParserState
+	public enum ParserState
 	{
 		PacketSize,
 		PacketBody
 	}
-	
+
 	public class Packet
 	{
 		public const int MinSize = 3;
@@ -15,15 +15,20 @@ namespace ETModel
 		public const int FlagIndex = 0;
 		public const int OpcodeIndex = 1;
 		public const int Index = 3;
-
+		
 		/// <summary>
 		/// 只读,不允许修改
 		/// </summary>
-		public byte[] Bytes { get; }
+		public byte[] Bytes { get; set; }
+		public ushort Offset { get; set; }
 		public ushort Length { get; set; }
 		public byte Flag { get; set; }
 		public ushort Opcode { get; set; }
 
+		public Packet()
+		{
+		}
+
 		public Packet(int length)
 		{
 			this.Length = 0;
@@ -37,12 +42,13 @@ namespace ETModel
 		}
 	}
 
-	internal class PacketParser
+	public class PacketParser
 	{
 		private readonly CircularBuffer buffer;
 		private ushort packetSize;
 		private ParserState state;
-		private readonly Packet packet = new Packet(ushort.MaxValue);
+		public readonly Packet packet = new Packet(ushort.MaxValue);
+		private readonly byte[] cache = new byte[2];
 		private bool isOK;
 
 		public PacketParser(CircularBuffer buffer)
@@ -70,7 +76,7 @@ namespace ETModel
 						else
 						{
 							this.buffer.Read(this.packet.Bytes, 0, 2);
-							this.packetSize = BitConverter.ToUInt16(this.packet.Bytes, 0);
+							packetSize = BitConverter.ToUInt16(this.packet.Bytes, 0);
 							if (packetSize < Packet.MinSize || packetSize > Packet.MaxSize)
 							{
 								throw new Exception($"packet size error: {this.packetSize}");
@@ -85,10 +91,14 @@ namespace ETModel
 						}
 						else
 						{
-							this.buffer.Read(this.packet.Bytes, 0, this.packetSize);
-							this.packet.Length = this.packetSize;
-							this.packet.Flag = this.packet.Bytes[0];
-							this.packet.Opcode = BitConverter.ToUInt16(this.packet.Bytes, Packet.OpcodeIndex);
+							this.buffer.Read(this.cache, 0, 1);
+							this.packet.Flag = this.cache[0];
+							this.buffer.Read(this.cache, 0, 2);
+							this.packet.Opcode = BitConverter.ToUInt16(this.cache, 0);
+							this.buffer.Read(this.packet.Bytes, 0, this.packetSize - Packet.Index);
+							this.packet.Length = (ushort) (this.packetSize - Packet.Index);
+							this.packet.Offset = 0;
+							
 							this.isOK = true;
 							this.state = ParserState.PacketSize;
 							finish = true;

+ 213 - 127
Unity/Assets/Scripts/Module/Message/Network/TCP/TChannel.cs

@@ -1,71 +1,57 @@
 using System;
 using System.Collections.Generic;
-using System.IO;
 using System.Linq;
 using System.Net;
 using System.Net.Sockets;
-using System.Threading.Tasks;
 
 namespace ETModel
 {
-	public class TChannel : AChannel
+	/// <summary>
+	/// 封装Socket,将回调push到主线程处理
+	/// </summary>
+	public sealed class TChannel: AChannel
 	{
-		private readonly TcpClient tcpClient;
+		private Socket socket;
+		private readonly SocketAsyncEventArgs innArgs = new SocketAsyncEventArgs();
+		private readonly SocketAsyncEventArgs outArgs = new SocketAsyncEventArgs();
 
 		private readonly CircularBuffer recvBuffer = new CircularBuffer();
 		private readonly CircularBuffer sendBuffer = new CircularBuffer();
 
 		private bool isSending;
-		private readonly PacketParser parser;
-		private bool isConnected;
 
-		/// <summary>
-		/// connect
-		/// </summary>
-		public TChannel(TcpClient tcpClient, IPEndPoint ipEndPoint, TService service) : base(service, ChannelType.Connect)
-		{
-			this.tcpClient = tcpClient;
-			this.parser = new PacketParser(this.recvBuffer);
-			this.RemoteAddress = ipEndPoint;
+		private bool isConnected;
 
-			this.ConnectAsync(ipEndPoint);
-		}
+		public readonly PacketParser parser;
 
-		/// <summary>
-		/// accept
-		/// </summary>
-		public TChannel(TcpClient tcpClient, TService service) : base(service, ChannelType.Accept)
+		public TChannel(IPEndPoint ipEndPoint, TService service): base(service, ChannelType.Connect)
 		{
-			this.tcpClient = tcpClient;
+			this.socket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
+			this.socket.NoDelay = true;
 			this.parser = new PacketParser(this.recvBuffer);
+			this.innArgs.Completed += this.OnComplete;
+			this.outArgs.Completed += this.OnComplete;
+			this.innArgs.UserToken = new UserTokenInfo() { InstanceId = this.InstanceId };
+			this.outArgs.UserToken = new UserTokenInfo() { InstanceId = this.InstanceId };
 
-			IPEndPoint ipEndPoint = (IPEndPoint)this.tcpClient.Client.RemoteEndPoint;
 			this.RemoteAddress = ipEndPoint;
-			this.OnAccepted();
 		}
-
-		private async void ConnectAsync(IPEndPoint ipEndPoint)
+		
+		public TChannel(Socket socket, TService service): base(service, ChannelType.Accept)
 		{
-			try
-			{
-				await this.tcpClient.ConnectAsync(ipEndPoint.Address, ipEndPoint.Port);
-				
-				this.isConnected = true;
-				this.StartSend();
-				this.StartRecv();
-			}
-			catch (SocketException e)
-			{
-				Log.Error($"connect error: {e.SocketErrorCode}");
-				this.OnError((int)e.SocketErrorCode);
-			}
-			catch (Exception e)
-			{
-				Log.Error($"connect error: {ipEndPoint} {e}");
-				this.OnError((int)SocketError.SocketError);
-			}
-		}
+			this.socket = socket;
+			this.socket.NoDelay = true;
+			this.parser = new PacketParser(this.recvBuffer);
+			this.innArgs.Completed += this.OnComplete;
+			this.outArgs.Completed += this.OnComplete;
+			this.innArgs.UserToken = new UserTokenInfo() { InstanceId = this.InstanceId };
+			this.outArgs.UserToken = new UserTokenInfo() { InstanceId = this.InstanceId };
 
+			this.RemoteAddress = (IPEndPoint)socket.RemoteEndPoint;
+			
+			this.isConnected = true;
+		}
+		
 		public override void Dispose()
 		{
 			if (this.IsDisposed)
@@ -74,12 +60,21 @@ namespace ETModel
 			}
 			
 			base.Dispose();
-			this.tcpClient.Close();
+			
+			this.socket.Close();
+			this.innArgs.Dispose();
+			this.outArgs.Dispose();
+			this.socket = null;
 		}
 
-		private void OnAccepted()
+		public override void Start()
 		{
-			this.isConnected = true;
+			if (!this.isConnected)
+			{
+				this.ConnectAsync(this.RemoteAddress);
+				return;
+			}
+			
 			this.StartSend();
 			this.StartRecv();
 		}
@@ -90,10 +85,10 @@ namespace ETModel
 			{
 				throw new Exception("TChannel已经被Dispose, 不能发送消息");
 			}
-			byte[] size = BitConverter.GetBytes((ushort)buffer.Length);
-			this.sendBuffer.Write(size, 0, size.Length);
+			byte[] sizeBuffer = BitConverter.GetBytes(length);
+			this.sendBuffer.Write(sizeBuffer, 0, sizeBuffer.Length);
 			this.sendBuffer.Write(buffer, index, length);
-			if (this.isConnected)
+			if (this.isConnected && !this.isSending)
 			{
 				this.StartSend();
 			}
@@ -112,115 +107,206 @@ namespace ETModel
 			{
 				this.sendBuffer.Write(buffer, 0, buffer.Length);
 			}
-			if (this.isConnected)
+			if (this.isConnected && !this.isSending)
 			{
 				this.StartSend();
 			}
 		}
 
-		private async void StartSend()
+		private void OnComplete(object sender, SocketAsyncEventArgs e)
+		{
+			switch (e.LastOperation)
+			{
+				case SocketAsyncOperation.Connect:
+					OneThreadSynchronizationContext.Instance.Post(this.OnConnectComplete, e);
+					break;
+				case SocketAsyncOperation.Receive:
+					OneThreadSynchronizationContext.Instance.Post(this.OnRecvComplete, e);
+					break;
+				case SocketAsyncOperation.Send:
+					OneThreadSynchronizationContext.Instance.Post(this.OnSendComplete, e);
+					break;
+				case SocketAsyncOperation.Disconnect:
+					OneThreadSynchronizationContext.Instance.Post(this.OnDisconnectComplete, e);
+					break;
+				default:
+					throw new Exception($"socket error: {e.LastOperation}");
+			}
+		}
+
+		public void ConnectAsync(IPEndPoint ipEndPoint)
+		{
+			this.outArgs.RemoteEndPoint = ipEndPoint;
+			if (this.socket.ConnectAsync(this.outArgs))
+			{
+				return;
+			}
+			OnConnectComplete(this.outArgs);
+		}
+
+		private void OnConnectComplete(object o)
+		{
+			SocketAsyncEventArgs e = (SocketAsyncEventArgs) o;
+			UserTokenInfo userTokenInfo = (UserTokenInfo) e.UserToken;
+			if (userTokenInfo.InstanceId != this.InstanceId)
+			{
+				return;
+			}
+
+			if (e.SocketError != SocketError.Success)
+			{
+				this.OnError((int)e.SocketError);	
+				return;
+			}
+			this.isConnected = true;
+			
+			this.StartSend();
+			this.StartRecv();
+		}
+
+		private void OnDisconnectComplete(object o)
+		{
+			SocketAsyncEventArgs e = (SocketAsyncEventArgs)o;
+			this.OnError((int)e.SocketError);
+		}
+
+		private void StartRecv()
+		{
+			int size = this.recvBuffer.ChunkSize - this.recvBuffer.LastIndex;
+			this.RecvAsync(this.recvBuffer.Last, this.recvBuffer.LastIndex, size);
+		}
+
+		public void RecvAsync(byte[] buffer, int offset, int count)
 		{
-			long instanceId = this.InstanceId;
 			try
 			{
-				// 如果正在发送中,不需要再次发送
-				if (this.isSending)
+				this.innArgs.SetBuffer(buffer, offset, count);
+			}
+			catch (Exception e)
+			{
+				throw new Exception($"socket set buffer error: {buffer.Length}, {offset}, {count}", e);
+			}
+			
+			if (this.socket.ReceiveAsync(this.innArgs))
+			{
+				return;
+			}
+			OnRecvComplete(this.innArgs);
+		}
+
+		private void OnRecvComplete(object o)
+		{
+			SocketAsyncEventArgs e = (SocketAsyncEventArgs)o;
+			UserTokenInfo userTokenInfo = (UserTokenInfo) e.UserToken;
+			if (userTokenInfo.InstanceId != this.InstanceId)
+			{
+				return;
+			}
+
+			if (e.SocketError != SocketError.Success)
+			{
+				this.OnError((int)e.SocketError);
+				return;
+			}
+
+			if (e.BytesTransferred == 0)
+			{
+				this.OnError((int)e.SocketError);
+				return;
+			}
+
+			this.recvBuffer.LastIndex += e.BytesTransferred;
+			if (this.recvBuffer.LastIndex == this.recvBuffer.ChunkSize)
+			{
+				this.recvBuffer.AddLast();
+				this.recvBuffer.LastIndex = 0;
+			}
+
+			// 收到消息回调
+			while (true)
+			{
+				if (!this.parser.Parse())
 				{
-					return;
+					break;
 				}
 
-				while (true)
+				Packet packet = this.parser.GetPacket();
+				try
+				{
+					this.OnRead(packet);
+				}
+				catch (Exception exception)
 				{
-					if (this.InstanceId != instanceId)
-					{
-						return;
-					}
-
-					// 没有数据需要发送
-					long buffLength = this.sendBuffer.Length;
-					if (buffLength == 0)
-					{
-						this.isSending = false;
-						return;
-					}
-
-					this.isSending = true;
-					
-					NetworkStream stream = this.tcpClient.GetStream();
-					if (!stream.CanWrite)
-					{
-						return;
-					}
-
-					await this.sendBuffer.WriteToAsync(stream);
+					Log.Error(exception);
 				}
 			}
-			catch (IOException)
+
+			if (userTokenInfo.InstanceId != this.InstanceId)
 			{
-				this.OnError((int)SocketError.SocketError);
+				return;
 			}
-			catch (ObjectDisposedException)
+			this.StartRecv();
+		}
+
+		private void StartSend()
+		{
+			// 没有数据需要发送
+			if (this.sendBuffer.Length == 0)
 			{
-				this.OnError((int)SocketError.SocketError);
+				this.isSending = false;
+				return;
 			}
-			catch (Exception e)
+
+			this.isSending = true;
+
+			int sendSize = this.sendBuffer.ChunkSize - this.sendBuffer.FirstIndex;
+			if (sendSize > this.sendBuffer.Length)
 			{
-				Log.Error(e);
-				this.OnError((int)SocketError.SocketError);
+				sendSize = (int)this.sendBuffer.Length;
 			}
+
+			this.SendAsync(this.sendBuffer.First, this.sendBuffer.FirstIndex, sendSize);
 		}
 
-		private async void StartRecv()
+		public void SendAsync(byte[] buffer, int offset, int count)
 		{
-			long instanceId = this.InstanceId;
 			try
 			{
-				while (true)
-				{
-					if (this.InstanceId != instanceId)
-					{
-						return;
-					}
-
-					NetworkStream stream = this.tcpClient.GetStream();
-					if (!stream.CanRead)
-					{
-						return;
-					}
-
-					int n = await this.recvBuffer.ReadFromAsync(stream);
-
-					if (n == 0)
-					{
-						this.OnError((int)SocketError.NetworkReset);
-						return;
-					}
-
-					while (true)
-					{
-						if (!this.parser.Parse())
-						{
-							break;
-						}
-
-						Packet packet = this.parser.GetPacket();
-						this.OnRead(packet);
-					}
-				}
+				this.outArgs.SetBuffer(buffer, offset, count);
 			}
-			catch (IOException)
+			catch (Exception e)
 			{
-				this.OnError((int)SocketError.SocketError);
+				throw new Exception($"socket set buffer error: {buffer.Length}, {offset}, {count}", e);
 			}
-			catch (ObjectDisposedException)
+			if (this.socket.SendAsync(this.outArgs))
 			{
-				this.OnError((int)SocketError.SocketError);
+				return;
 			}
-			catch (Exception e)
+			OnSendComplete(this.outArgs);
+		}
+
+		private void OnSendComplete(object o)
+		{
+			SocketAsyncEventArgs e = (SocketAsyncEventArgs)o;
+			UserTokenInfo userTokenInfo = (UserTokenInfo) e.UserToken;
+			if (userTokenInfo.InstanceId != this.InstanceId)
+			{
+				return;
+			}
+
+			if (e.SocketError != SocketError.Success)
 			{
-				Log.Error(e);
-				this.OnError((int)SocketError.SocketError);
+				this.OnError((int)e.SocketError);
+				return;
 			}
+			this.sendBuffer.FirstIndex += e.BytesTransferred;
+			if (this.sendBuffer.FirstIndex == this.sendBuffer.ChunkSize)
+			{
+				this.sendBuffer.FirstIndex = 0;
+				this.sendBuffer.RemoveFirst();
+			}
+
+			this.StartSend();
 		}
 	}
 }

+ 67 - 22
Unity/Assets/Scripts/Module/Message/Network/TCP/TService.cs

@@ -7,72 +7,117 @@ using System.Threading.Tasks;
 
 namespace ETModel
 {
-	public sealed class TService: AService
+	public sealed class TService : AService
 	{
-		private TcpListener acceptor;
-
 		private readonly Dictionary<long, TChannel> idChannels = new Dictionary<long, TChannel>();
+
+		private readonly SocketAsyncEventArgs innArgs = new SocketAsyncEventArgs();
+		private Socket acceptor;
 		
 		/// <summary>
 		/// 即可做client也可做server
 		/// </summary>
 		public TService(IPEndPoint ipEndPoint)
 		{
-			this.acceptor = new TcpListener(ipEndPoint);
-			this.acceptor.Server.SetSocketOption(SocketOptionLevel.Socket, SocketOptionName.ReuseAddress, true);
-			this.acceptor.Server.NoDelay = true;
-			this.acceptor.Start();
+			this.acceptor = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
+			this.acceptor.SetSocketOption(SocketOptionLevel.Socket, SocketOptionName.ReuseAddress, true);
+			this.innArgs.Completed += this.OnAcceptComplete;
+			this.innArgs.UserToken = new UserTokenInfo() { InstanceId = this.InstanceId };
+			
+			this.acceptor.Bind(ipEndPoint);
+			this.acceptor.Listen(1000);
 		}
 
 		public TService()
 		{
 		}
-
+		
 		public override void Dispose()
 		{
-			if (this.acceptor == null)
+			if (this.IsDisposed)
 			{
 				return;
 			}
+			
+			base.Dispose();
 
 			foreach (long id in this.idChannels.Keys.ToArray())
 			{
 				TChannel channel = this.idChannels[id];
 				channel.Dispose();
 			}
-			this.acceptor.Stop();
+			this.acceptor?.Close();
 			this.acceptor = null;
+			this.innArgs.Dispose();
+		}
+
+		public override void Start()
+		{
+			if (this.acceptor != null)
+			{
+				this.AcceptAsync();
+			}
 		}
 		
-		public override AChannel GetChannel(long id)
+		public void AcceptAsync()
 		{
-			TChannel channel = null;
-			this.idChannels.TryGetValue(id, out channel);
-			return channel;
+			this.innArgs.AcceptSocket = null;
+			if (this.acceptor.AcceptAsync(this.innArgs))
+			{
+				return;
+			}
+			OnAcceptComplete(this, this.innArgs);
 		}
 
-		public override async Task<AChannel> AcceptChannel()
+		private void OnAcceptComplete(object sender, SocketAsyncEventArgs o)
 		{
-			if (this.acceptor == null)
+			SocketAsyncEventArgs e = o;
+			UserTokenInfo userTokenInfo = (UserTokenInfo) e.UserToken;
+			if (userTokenInfo.InstanceId != this.InstanceId)
+			{
+				return;
+			}
+			
+			if (e.SocketError != SocketError.Success)
 			{
-				throw new Exception("service construct must use host and port param");
+				Log.Error($"accept error {e.SocketError}");
+				return;
 			}
-			TcpClient tcpClient = await this.acceptor.AcceptTcpClientAsync();
-			TChannel channel = new TChannel(tcpClient, this);
+			TChannel channel = new TChannel(e.AcceptSocket, this);
 			this.idChannels[channel.Id] = channel;
+
+			try
+			{
+				this.OnAccept(channel);
+			}
+			catch (Exception exception)
+			{
+				Log.Error(exception);
+			}
+
+			if (userTokenInfo.InstanceId != this.InstanceId)
+			{
+				return;
+			}
+			
+			this.AcceptAsync();
+		}
+		
+		public override AChannel GetChannel(long id)
+		{
+			TChannel channel = null;
+			this.idChannels.TryGetValue(id, out channel);
 			return channel;
 		}
 
 		public override AChannel ConnectChannel(IPEndPoint ipEndPoint)
 		{
-			TcpClient tcpClient = new TcpClient();
-			TChannel channel = new TChannel(tcpClient, ipEndPoint, this);
+			TChannel channel = new TChannel(ipEndPoint, this);
 			this.idChannels[channel.Id] = channel;
 
 			return channel;
 		}
 
-
 		public override void Remove(long id)
 		{
 			TChannel channel;

+ 34 - 69
Unity/Assets/Scripts/Module/Message/NetworkComponent.cs

@@ -2,15 +2,14 @@
 using System.Collections.Generic;
 using System.Linq;
 using System.Net;
-using System.Threading.Tasks;
 
 namespace ETModel
 {
 	public abstract class NetworkComponent : Component
 	{
-		private AService Service;
-
 		public AppType AppType;
+		
+		private AService Service;
 
 		private readonly Dictionary<long, Session> sessions = new Dictionary<long, Session>();
 
@@ -20,16 +19,25 @@ namespace ETModel
 
 		public void Awake(NetworkProtocol protocol)
 		{
-			switch (protocol)
+			try
+			{
+				switch (protocol)
+				{
+					case NetworkProtocol.KCP:
+						this.Service = new KService();
+						break;
+					case NetworkProtocol.TCP:
+						this.Service = new TService();
+						break;
+					default:
+						throw new ArgumentOutOfRangeException();
+				}
+
+				this.Service.AcceptCallback += this.OnAccept;
+			}
+			catch (Exception e)
 			{
-				case NetworkProtocol.TCP:
-					this.Service = new TService();
-					break;
-				case NetworkProtocol.KCP:
-					this.Service = new KService();
-					break;
-				default:
-					throw new ArgumentOutOfRangeException();
+				throw new Exception($"{e}");
 			}
 		}
 
@@ -39,17 +47,17 @@ namespace ETModel
 			{
 				switch (protocol)
 				{
-					case NetworkProtocol.TCP:
-						this.Service = new TService(ipEndPoint);
-						break;
 					case NetworkProtocol.KCP:
 						this.Service = new KService(ipEndPoint);
 						break;
+					case NetworkProtocol.TCP:
+						this.Service = new TService(ipEndPoint);
+						break;
 					default:
 						throw new ArgumentOutOfRangeException();
 				}
-
-				this.StartAccept();
+				
+				this.Service.AcceptCallback += this.OnAccept;
 			}
 			catch (Exception e)
 			{
@@ -57,41 +65,15 @@ namespace ETModel
 			}
 		}
 
-		private async void StartAccept()
+		public void Start()
 		{
-			while (true)
-			{
-				if (this.IsDisposed)
-				{
-					return;
-				}
-
-				try
-				{
-					await this.Accept();
-				}
-				catch (Exception e)
-				{
-					Log.Error(e);
-				}
-			}
+			this.Service.Start();
 		}
 
-		public virtual async Task<Session> Accept()
+		public void OnAccept(AChannel channel)
 		{
-			AChannel channel = await this.Service.AcceptChannel();
-			Session session = ComponentFactory.CreateWithId<Session, NetworkComponent, AChannel>(IdGenerater.GenerateId(), this, channel);
-			session.Parent = this;
-			channel.ErrorCallback += (c, e) =>
-			{
-				session.Error = e;
-				this.Remove(session.Id);
-			};
-
-			channel.ReadCallback += (packet) => { session.OnRead(packet); };
-			
+			Session session = ComponentFactory.CreateWithParent<Session, NetworkComponent, AChannel>(this, this, channel);
 			this.sessions.Add(session.Id, session);
-			return session;
 		}
 
 		public virtual void Remove(long id)
@@ -115,29 +97,12 @@ namespace ETModel
 		/// <summary>
 		/// 创建一个新Session
 		/// </summary>
-		public virtual Session Create(IPEndPoint ipEndPoint)
+		public Session Create(IPEndPoint ipEndPoint)
 		{
-			try
-			{
-				AChannel channel = this.Service.ConnectChannel(ipEndPoint);
-				Session session = ComponentFactory.CreateWithId<Session, NetworkComponent, AChannel>(IdGenerater.GenerateId(), this, channel);
-				session.Parent = this;
-				channel.ErrorCallback += (c, e) =>
-				{
-					session.Error = e;
-					this.Remove(session.Id);
-				};
-				
-				channel.ReadCallback += (packet) => { session.OnRead(packet); };
-				
-				this.sessions.Add(session.Id, session);
-				return session;
-			}
-			catch (Exception e)
-			{
-				Log.Error(e);
-				return null;
-			}
+			AChannel channel = this.Service.ConnectChannel(ipEndPoint);
+			Session session = ComponentFactory.CreateWithParent<Session, NetworkComponent, AChannel>(this, this, channel);
+			this.sessions.Add(session.Id, session);
+			return session;
 		}
 
 		public void Update()

+ 6 - 0
Unity/Assets/Scripts/Module/Message/OuterMessage.cs

@@ -211,4 +211,10 @@ namespace ETModel
 
 	}
 
+	[Message(OuterOpcode.G2C_Test)]
+	[ProtoContract]
+	public partial class G2C_Test: IMessage
+	{
+	}
+
 }

+ 1 - 0
Unity/Assets/Scripts/Module/Message/OuterOpcode.cs

@@ -16,5 +16,6 @@ namespace ETModel
 		 public const ushort M2C_Reload = 112;
 		 public const ushort C2R_Ping = 113;
 		 public const ushort R2C_Ping = 114;
+		 public const ushort G2C_Test = 115;
 	}
 }

+ 36 - 21
Unity/Assets/Scripts/Module/Message/Session.cs

@@ -17,6 +17,15 @@ namespace ETModel
 		}
 	}
 
+	[ObjectSystem]
+	public class SessionStartSystem : StartSystem<Session>
+	{
+		public override void Start(Session self)
+		{
+			self.Start();
+		}
+	}
+
 	public sealed class Session : Entity
 	{
 		private static int RpcId { get; set; }
@@ -34,11 +43,23 @@ namespace ETModel
 			}
 		}
 
-		public void Awake(NetworkComponent net, AChannel c)
+		public void Awake(NetworkComponent net, AChannel aChannel)
 		{
 			this.Error = 0;
-			this.channel = c;
+			this.channel = aChannel;
 			this.requestCallback.Clear();
+			
+			channel.ErrorCallback += (c, e) =>
+			{
+				this.Error = e;
+				this.Network.Remove(this.Id); 
+			};
+			channel.ReadCallback += this.OnRead;
+		}
+
+		public void Start()
+		{
+			this.channel?.Start();
 		}
 
 		public override void Dispose()
@@ -51,10 +72,10 @@ namespace ETModel
 			long id = this.Id;
 
 			base.Dispose();
-
+			
 			foreach (Action<IResponse> action in this.requestCallback.Values.ToArray())
 			{
-				action.Invoke(new ResponseMessage { Error = this.Error });
+				action.Invoke(new ResponseMessage { Error = ErrorCode.ERR_SessionDispose });
 			}
 
 			this.Error = 0;
@@ -95,7 +116,7 @@ namespace ETModel
 		{
 			byte flag = packet.Flag;
 			ushort opcode = packet.Opcode;
-
+			
 #if !SERVER
 			if (OpcodeHelper.IsClientHotfixMessage(opcode))
 			{
@@ -116,7 +137,7 @@ namespace ETModel
 			{
 				OpcodeTypeComponent opcodeTypeComponent = this.Network.Entity.GetComponent<OpcodeTypeComponent>();
 				Type responseType = opcodeTypeComponent.GetType(opcode);
-				message = this.Network.MessagePacker.DeserializeFrom(responseType, packet.Bytes, Packet.Index, packet.Length - Packet.Index);
+				message = this.Network.MessagePacker.DeserializeFrom(responseType, packet.Bytes, packet.Offset, packet.Length);
 				//Log.Debug($"recv: {JsonHelper.ToJson(message)}");
 			}
 			catch (Exception e)
@@ -238,27 +259,21 @@ namespace ETModel
 			if (this.Network.AppType == AppType.AllServer)
 			{
 				Session session = this.Network.Entity.GetComponent<NetInnerComponent>().Get(this.RemoteAddress);
-				this.pkt.Length = 0;
-				ushort index = 0;
-				foreach (var byts in byteses)
-				{
-					Array.Copy(byts, 0, this.pkt.Bytes, index, byts.Length);
-					index += (ushort)byts.Length;
-				}
 
-				this.pkt.Length = index;
-				this.pkt.Flag = flag;
-				this.pkt.Opcode = opcode;
-				session.Run(this.pkt);
+				Packet packet = ((TChannel)this.channel).parser.packet;
+
+				Array.Copy(bytes, 0, packet.Bytes, 0, bytes.Length);
+
+				packet.Offset = 0;
+				packet.Length = (ushort)bytes.Length;
+				packet.Flag = flag;
+				packet.Opcode = opcode;
+				session.Run(packet);
 				return;
 			}
 #endif
 
 			channel.Send(this.byteses);
 		}
-
-#if SERVER
-		private readonly Packet pkt = new Packet(ushort.MaxValue);
-#endif
 	}
 }

+ 45 - 0
Unity/Hotfix/Base/Object/ComponentFactory.cs

@@ -8,6 +8,11 @@ namespace ETHotfix
 		{
 			Component component = Game.ObjectPool.Fetch(type);
 			component.Parent = parent;
+			ComponentWithId componentWithId = component as ComponentWithId;
+			if (componentWithId != null)
+			{
+				componentWithId.Id = component.InstanceId;
+			}
 			Game.EventSystem.Awake(component);
 			return component;
 		}
@@ -16,6 +21,11 @@ namespace ETHotfix
 		{
 			T component = Game.ObjectPool.Fetch<T>();
 			component.Parent = parent;
+			ComponentWithId componentWithId = component as ComponentWithId;
+			if (componentWithId != null)
+			{
+				componentWithId.Id = component.InstanceId;
+			}
 			Game.EventSystem.Awake(component);
 			return component;
 		}
@@ -24,6 +34,11 @@ namespace ETHotfix
 		{
 			T component = Game.ObjectPool.Fetch<T>();
 			component.Parent = parent;
+			ComponentWithId componentWithId = component as ComponentWithId;
+			if (componentWithId != null)
+			{
+				componentWithId.Id = component.InstanceId;
+			}
 			Game.EventSystem.Awake(component, a);
 			return component;
 		}
@@ -32,6 +47,11 @@ namespace ETHotfix
 		{
 			T component = Game.ObjectPool.Fetch<T>();
 			component.Parent = parent;
+			ComponentWithId componentWithId = component as ComponentWithId;
+			if (componentWithId != null)
+			{
+				componentWithId.Id = component.InstanceId;
+			}
 			Game.EventSystem.Awake(component, a, b);
 			return component;
 		}
@@ -40,6 +60,11 @@ namespace ETHotfix
 		{
 			T component = Game.ObjectPool.Fetch<T>();
 			component.Parent = parent;
+			ComponentWithId componentWithId = component as ComponentWithId;
+			if (componentWithId != null)
+			{
+				componentWithId.Id = component.InstanceId;
+			}
 			Game.EventSystem.Awake(component, a, b, c);
 			return component;
 		}
@@ -47,6 +72,11 @@ namespace ETHotfix
 		public static T Create<T>() where T : Component
 		{
 			T component = Game.ObjectPool.Fetch<T>();
+			ComponentWithId componentWithId = component as ComponentWithId;
+			if (componentWithId != null)
+			{
+				componentWithId.Id = component.InstanceId;
+			}
 			Game.EventSystem.Awake(component);
 			return component;
 		}
@@ -54,6 +84,11 @@ namespace ETHotfix
 		public static T Create<T, A>(A a) where T : Component
 		{
 			T component = Game.ObjectPool.Fetch<T>();
+			ComponentWithId componentWithId = component as ComponentWithId;
+			if (componentWithId != null)
+			{
+				componentWithId.Id = component.InstanceId;
+			}
 			Game.EventSystem.Awake(component, a);
 			return component;
 		}
@@ -61,6 +96,11 @@ namespace ETHotfix
 		public static T Create<T, A, B>(A a, B b) where T : Component
 		{
 			T component = Game.ObjectPool.Fetch<T>();
+			ComponentWithId componentWithId = component as ComponentWithId;
+			if (componentWithId != null)
+			{
+				componentWithId.Id = component.InstanceId;
+			}
 			Game.EventSystem.Awake(component, a, b);
 			return component;
 		}
@@ -68,6 +108,11 @@ namespace ETHotfix
 		public static T Create<T, A, B, C>(A a, B b, C c) where T : Component
 		{
 			T component = Game.ObjectPool.Fetch<T>();
+			ComponentWithId componentWithId = component as ComponentWithId;
+			if (componentWithId != null)
+			{
+				componentWithId.Id = component.InstanceId;
+			}
 			Game.EventSystem.Awake(component, a, b, c);
 			return component;
 		}

+ 14 - 6
Unity/Hotfix/Module/Message/Session.cs

@@ -1,5 +1,6 @@
 using System;
 using System.Collections.Generic;
+using System.Linq;
 using System.Threading;
 using System.Threading.Tasks;
 using ETModel;
@@ -17,7 +18,7 @@ namespace ETHotfix
 			sessionComponent.DisposeCallback = s => { self.Dispose(); };
 		}
 	}
-	
+
 	/// <summary>
 	/// 用来收发热更层的消息
 	/// </summary>
@@ -36,18 +37,25 @@ namespace ETHotfix
 			}
 			
 			base.Dispose();
-			
+
+			foreach (Action<IResponse> action in this.requestCallback.Values.ToArray())
+			{
+				action.Invoke(new ResponseMessage { Error = ErrorCode.ERR_SessionDispose });
+			}
+
+			this.requestCallback.Clear();
+
 			this.session.Dispose();
 		}
 
-		public void Run(ETModel.Session s, Packet p)
+		public void Run(ETModel.Session s, Packet packet)
 		{
-			ushort opcode = p.Opcode;
-			byte flag = p.Flag;
+			ushort opcode = packet.Opcode;
+			byte flag = packet.Flag;
 
 			OpcodeTypeComponent opcodeTypeComponent = Game.Scene.GetComponent<OpcodeTypeComponent>();
 			Type responseType = opcodeTypeComponent.GetType(opcode);
-			object message = ProtobufHelper.FromBytes(responseType, p.Bytes, Packet.Index, p.Length - Packet.Index);
+			object message = ProtobufHelper.FromBytes(responseType, packet.Bytes, packet.Offset, packet.Length);
 
 			if ((flag & 0x01) > 0)
 			{

+ 86 - 86
Unity/Unity.Editor.Plugins.csproj

@@ -16,7 +16,7 @@
     <CompilerResponseFile></CompilerResponseFile>
     <UnityProjectGenerator>VSTU</UnityProjectGenerator>
     <UnityProjectType>EditorPlugins:7</UnityProjectType>
-    <UnityBuildTarget>StandaloneWindows64:19</UnityBuildTarget>
+    <UnityBuildTarget>StandaloneWindows:5</UnityBuildTarget>
     <UnityVersion>2017.4.3f1</UnityVersion>
     <RootNamespace></RootNamespace>
     <LangVersion>6</LangVersion>
@@ -33,7 +33,7 @@
     <IntermediateOutputPath>Temp\UnityVS_obj\Debug\</IntermediateOutputPath>
     <ErrorReport>prompt</ErrorReport>
     <WarningLevel>4</WarningLevel>
-    <DefineConstants>DEBUG;TRACE;UNITY_5_3_OR_NEWER;UNITY_5_4_OR_NEWER;UNITY_5_5_OR_NEWER;UNITY_5_6_OR_NEWER;UNITY_2017_1_OR_NEWER;UNITY_2017_2_OR_NEWER;UNITY_2017_3_OR_NEWER;UNITY_2017_4_OR_NEWER;UNITY_2017_4_3;UNITY_2017_4;UNITY_2017;PLATFORM_ARCH_64;UNITY_64;ENABLE_AUDIO;ENABLE_CACHING;ENABLE_CLOTH;ENABLE_DUCK_TYPING;ENABLE_GENERICS;ENABLE_PVR_GI;ENABLE_MICROPHONE;ENABLE_MULTIPLE_DISPLAYS;ENABLE_PHYSICS;ENABLE_SPRITERENDERER_FLIPPING;ENABLE_SPRITES;ENABLE_GRID;ENABLE_TILEMAP;ENABLE_TERRAIN;ENABLE_RAKNET;ENABLE_DIRECTOR;ENABLE_UNET;ENABLE_LZMA;ENABLE_UNITYEVENTS;ENABLE_WEBCAM;ENABLE_WWW;ENABLE_CLOUD_SERVICES_COLLAB;ENABLE_CLOUD_SERVICES_COLLAB_SOFTLOCKS;ENABLE_CLOUD_SERVICES_ADS;ENABLE_CLOUD_HUB;ENABLE_CLOUD_PROJECT_ID;ENABLE_CLOUD_SERVICES_USE_WEBREQUEST;ENABLE_CLOUD_SERVICES_UNET;ENABLE_CLOUD_SERVICES_BUILD;ENABLE_CLOUD_LICENSE;ENABLE_EDITOR_HUB;ENABLE_EDITOR_HUB_LICENSE;ENABLE_WEBSOCKET_CLIENT;ENABLE_DIRECTOR_AUDIO;ENABLE_DIRECTOR_TEXTURE;ENABLE_TIMELINE;ENABLE_EDITOR_METRICS;ENABLE_EDITOR_METRICS_CACHING;ENABLE_NATIVE_ARRAY;ENABLE_SPRITE_MASKING;INCLUDE_DYNAMIC_GI;INCLUDE_GI;ENABLE_MONO_BDWGC;PLATFORM_SUPPORTS_MONO;RENDER_SOFTWARE_CURSOR;INCLUDE_PUBNUB;ENABLE_PLAYMODE_TESTS_RUNNER;ENABLE_VIDEO;ENABLE_RMGUI;ENABLE_PACKMAN;ENABLE_CUSTOM_RENDER_TEXTURE;ENABLE_STYLE_SHEETS;ENABLE_LOCALIZATION;PLATFORM_STANDALONE_WIN;PLATFORM_STANDALONE;UNITY_STANDALONE_WIN;UNITY_STANDALONE;ENABLE_SUBSTANCE;ENABLE_RUNTIME_GI;ENABLE_MOVIES;ENABLE_NETWORK;ENABLE_CRUNCH_TEXTURE_COMPRESSION;ENABLE_UNITYWEBREQUEST;ENABLE_CLOUD_SERVICES;ENABLE_CLOUD_SERVICES_ANALYTICS;ENABLE_CLOUD_SERVICES_PURCHASING;ENABLE_CLOUD_SERVICES_CRASH_REPORTING;ENABLE_EVENT_QUEUE;ENABLE_CLUSTERINPUT;ENABLE_VR;ENABLE_AR;ENABLE_WEBSOCKET_HOST;ENABLE_MONO;NET_4_6;ENABLE_PROFILER;DEBUG;TRACE;UNITY_ASSERTIONS;UNITY_EDITOR;UNITY_EDITOR_64;UNITY_EDITOR_WIN;ENABLE_NATIVE_ARRAY_CHECKS;UNITY_TEAM_LICENSE;ENABLE_VSTU;UNITY_PRO_LICENSE;NET45;ILRuntime</DefineConstants>
+    <DefineConstants>DEBUG;TRACE;UNITY_5_3_OR_NEWER;UNITY_5_4_OR_NEWER;UNITY_5_5_OR_NEWER;UNITY_5_6_OR_NEWER;UNITY_2017_1_OR_NEWER;UNITY_2017_2_OR_NEWER;UNITY_2017_3_OR_NEWER;UNITY_2017_4_OR_NEWER;UNITY_2017_4_3;UNITY_2017_4;UNITY_2017;ENABLE_AUDIO;ENABLE_CACHING;ENABLE_CLOTH;ENABLE_DUCK_TYPING;ENABLE_GENERICS;ENABLE_PVR_GI;ENABLE_MICROPHONE;ENABLE_MULTIPLE_DISPLAYS;ENABLE_PHYSICS;ENABLE_SPRITERENDERER_FLIPPING;ENABLE_SPRITES;ENABLE_GRID;ENABLE_TILEMAP;ENABLE_TERRAIN;ENABLE_RAKNET;ENABLE_DIRECTOR;ENABLE_UNET;ENABLE_LZMA;ENABLE_UNITYEVENTS;ENABLE_WEBCAM;ENABLE_WWW;ENABLE_CLOUD_SERVICES_COLLAB;ENABLE_CLOUD_SERVICES_COLLAB_SOFTLOCKS;ENABLE_CLOUD_SERVICES_ADS;ENABLE_CLOUD_HUB;ENABLE_CLOUD_PROJECT_ID;ENABLE_CLOUD_SERVICES_USE_WEBREQUEST;ENABLE_CLOUD_SERVICES_UNET;ENABLE_CLOUD_SERVICES_BUILD;ENABLE_CLOUD_LICENSE;ENABLE_EDITOR_HUB;ENABLE_EDITOR_HUB_LICENSE;ENABLE_WEBSOCKET_CLIENT;ENABLE_DIRECTOR_AUDIO;ENABLE_DIRECTOR_TEXTURE;ENABLE_TIMELINE;ENABLE_EDITOR_METRICS;ENABLE_EDITOR_METRICS_CACHING;ENABLE_NATIVE_ARRAY;ENABLE_SPRITE_MASKING;INCLUDE_DYNAMIC_GI;INCLUDE_GI;ENABLE_MONO_BDWGC;PLATFORM_SUPPORTS_MONO;RENDER_SOFTWARE_CURSOR;INCLUDE_PUBNUB;ENABLE_PLAYMODE_TESTS_RUNNER;ENABLE_VIDEO;ENABLE_RMGUI;ENABLE_PACKMAN;ENABLE_CUSTOM_RENDER_TEXTURE;ENABLE_STYLE_SHEETS;ENABLE_LOCALIZATION;PLATFORM_STANDALONE_WIN;PLATFORM_STANDALONE;UNITY_STANDALONE_WIN;UNITY_STANDALONE;ENABLE_SUBSTANCE;ENABLE_RUNTIME_GI;ENABLE_MOVIES;ENABLE_NETWORK;ENABLE_CRUNCH_TEXTURE_COMPRESSION;ENABLE_UNITYWEBREQUEST;ENABLE_CLOUD_SERVICES;ENABLE_CLOUD_SERVICES_ANALYTICS;ENABLE_CLOUD_SERVICES_PURCHASING;ENABLE_CLOUD_SERVICES_CRASH_REPORTING;ENABLE_EVENT_QUEUE;ENABLE_CLUSTERINPUT;ENABLE_VR;ENABLE_AR;ENABLE_WEBSOCKET_HOST;ENABLE_MONO;NET_4_6;ENABLE_PROFILER;DEBUG;TRACE;UNITY_ASSERTIONS;UNITY_EDITOR;UNITY_EDITOR_64;UNITY_EDITOR_WIN;ENABLE_NATIVE_ARRAY_CHECKS;UNITY_TEAM_LICENSE;ENABLE_VSTU;UNITY_PRO_LICENSE;NET45;ILRuntime1</DefineConstants>
     <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
   </PropertyGroup>
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
@@ -43,240 +43,240 @@
     <IntermediateOutputPath>Temp\UnityVS_obj\Release\</IntermediateOutputPath>
     <ErrorReport>prompt</ErrorReport>
     <WarningLevel>4</WarningLevel>
-    <DefineConstants>TRACE;UNITY_5_3_OR_NEWER;UNITY_5_4_OR_NEWER;UNITY_5_5_OR_NEWER;UNITY_5_6_OR_NEWER;UNITY_2017_1_OR_NEWER;UNITY_2017_2_OR_NEWER;UNITY_2017_3_OR_NEWER;UNITY_2017_4_OR_NEWER;UNITY_2017_4_3;UNITY_2017_4;UNITY_2017;PLATFORM_ARCH_64;UNITY_64;ENABLE_AUDIO;ENABLE_CACHING;ENABLE_CLOTH;ENABLE_DUCK_TYPING;ENABLE_GENERICS;ENABLE_PVR_GI;ENABLE_MICROPHONE;ENABLE_MULTIPLE_DISPLAYS;ENABLE_PHYSICS;ENABLE_SPRITERENDERER_FLIPPING;ENABLE_SPRITES;ENABLE_GRID;ENABLE_TILEMAP;ENABLE_TERRAIN;ENABLE_RAKNET;ENABLE_DIRECTOR;ENABLE_UNET;ENABLE_LZMA;ENABLE_UNITYEVENTS;ENABLE_WEBCAM;ENABLE_WWW;ENABLE_CLOUD_SERVICES_COLLAB;ENABLE_CLOUD_SERVICES_COLLAB_SOFTLOCKS;ENABLE_CLOUD_SERVICES_ADS;ENABLE_CLOUD_HUB;ENABLE_CLOUD_PROJECT_ID;ENABLE_CLOUD_SERVICES_USE_WEBREQUEST;ENABLE_CLOUD_SERVICES_UNET;ENABLE_CLOUD_SERVICES_BUILD;ENABLE_CLOUD_LICENSE;ENABLE_EDITOR_HUB;ENABLE_EDITOR_HUB_LICENSE;ENABLE_WEBSOCKET_CLIENT;ENABLE_DIRECTOR_AUDIO;ENABLE_DIRECTOR_TEXTURE;ENABLE_TIMELINE;ENABLE_EDITOR_METRICS;ENABLE_EDITOR_METRICS_CACHING;ENABLE_NATIVE_ARRAY;ENABLE_SPRITE_MASKING;INCLUDE_DYNAMIC_GI;INCLUDE_GI;ENABLE_MONO_BDWGC;PLATFORM_SUPPORTS_MONO;RENDER_SOFTWARE_CURSOR;INCLUDE_PUBNUB;ENABLE_PLAYMODE_TESTS_RUNNER;ENABLE_VIDEO;ENABLE_RMGUI;ENABLE_PACKMAN;ENABLE_CUSTOM_RENDER_TEXTURE;ENABLE_STYLE_SHEETS;ENABLE_LOCALIZATION;PLATFORM_STANDALONE_WIN;PLATFORM_STANDALONE;UNITY_STANDALONE_WIN;UNITY_STANDALONE;ENABLE_SUBSTANCE;ENABLE_RUNTIME_GI;ENABLE_MOVIES;ENABLE_NETWORK;ENABLE_CRUNCH_TEXTURE_COMPRESSION;ENABLE_UNITYWEBREQUEST;ENABLE_CLOUD_SERVICES;ENABLE_CLOUD_SERVICES_ANALYTICS;ENABLE_CLOUD_SERVICES_PURCHASING;ENABLE_CLOUD_SERVICES_CRASH_REPORTING;ENABLE_EVENT_QUEUE;ENABLE_CLUSTERINPUT;ENABLE_VR;ENABLE_AR;ENABLE_WEBSOCKET_HOST;ENABLE_MONO;NET_4_6;ENABLE_PROFILER;DEBUG;TRACE;UNITY_ASSERTIONS;UNITY_EDITOR;UNITY_EDITOR_64;UNITY_EDITOR_WIN;ENABLE_NATIVE_ARRAY_CHECKS;UNITY_TEAM_LICENSE;ENABLE_VSTU;UNITY_PRO_LICENSE;NET45;ILRuntime</DefineConstants>
+    <DefineConstants>TRACE;UNITY_5_3_OR_NEWER;UNITY_5_4_OR_NEWER;UNITY_5_5_OR_NEWER;UNITY_5_6_OR_NEWER;UNITY_2017_1_OR_NEWER;UNITY_2017_2_OR_NEWER;UNITY_2017_3_OR_NEWER;UNITY_2017_4_OR_NEWER;UNITY_2017_4_3;UNITY_2017_4;UNITY_2017;ENABLE_AUDIO;ENABLE_CACHING;ENABLE_CLOTH;ENABLE_DUCK_TYPING;ENABLE_GENERICS;ENABLE_PVR_GI;ENABLE_MICROPHONE;ENABLE_MULTIPLE_DISPLAYS;ENABLE_PHYSICS;ENABLE_SPRITERENDERER_FLIPPING;ENABLE_SPRITES;ENABLE_GRID;ENABLE_TILEMAP;ENABLE_TERRAIN;ENABLE_RAKNET;ENABLE_DIRECTOR;ENABLE_UNET;ENABLE_LZMA;ENABLE_UNITYEVENTS;ENABLE_WEBCAM;ENABLE_WWW;ENABLE_CLOUD_SERVICES_COLLAB;ENABLE_CLOUD_SERVICES_COLLAB_SOFTLOCKS;ENABLE_CLOUD_SERVICES_ADS;ENABLE_CLOUD_HUB;ENABLE_CLOUD_PROJECT_ID;ENABLE_CLOUD_SERVICES_USE_WEBREQUEST;ENABLE_CLOUD_SERVICES_UNET;ENABLE_CLOUD_SERVICES_BUILD;ENABLE_CLOUD_LICENSE;ENABLE_EDITOR_HUB;ENABLE_EDITOR_HUB_LICENSE;ENABLE_WEBSOCKET_CLIENT;ENABLE_DIRECTOR_AUDIO;ENABLE_DIRECTOR_TEXTURE;ENABLE_TIMELINE;ENABLE_EDITOR_METRICS;ENABLE_EDITOR_METRICS_CACHING;ENABLE_NATIVE_ARRAY;ENABLE_SPRITE_MASKING;INCLUDE_DYNAMIC_GI;INCLUDE_GI;ENABLE_MONO_BDWGC;PLATFORM_SUPPORTS_MONO;RENDER_SOFTWARE_CURSOR;INCLUDE_PUBNUB;ENABLE_PLAYMODE_TESTS_RUNNER;ENABLE_VIDEO;ENABLE_RMGUI;ENABLE_PACKMAN;ENABLE_CUSTOM_RENDER_TEXTURE;ENABLE_STYLE_SHEETS;ENABLE_LOCALIZATION;PLATFORM_STANDALONE_WIN;PLATFORM_STANDALONE;UNITY_STANDALONE_WIN;UNITY_STANDALONE;ENABLE_SUBSTANCE;ENABLE_RUNTIME_GI;ENABLE_MOVIES;ENABLE_NETWORK;ENABLE_CRUNCH_TEXTURE_COMPRESSION;ENABLE_UNITYWEBREQUEST;ENABLE_CLOUD_SERVICES;ENABLE_CLOUD_SERVICES_ANALYTICS;ENABLE_CLOUD_SERVICES_PURCHASING;ENABLE_CLOUD_SERVICES_CRASH_REPORTING;ENABLE_EVENT_QUEUE;ENABLE_CLUSTERINPUT;ENABLE_VR;ENABLE_AR;ENABLE_WEBSOCKET_HOST;ENABLE_MONO;NET_4_6;ENABLE_PROFILER;DEBUG;TRACE;UNITY_ASSERTIONS;UNITY_EDITOR;UNITY_EDITOR_64;UNITY_EDITOR_WIN;ENABLE_NATIVE_ARRAY_CHECKS;UNITY_TEAM_LICENSE;ENABLE_VSTU;UNITY_PRO_LICENSE;NET45;ILRuntime1</DefineConstants>
     <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
   </PropertyGroup>
   <ItemGroup>
     <Reference Include="mscorlib">
-      <HintPath>C:\Apps\Unity\Editor\Data\MonoBleedingEdge\lib\mono\4.6-api\mscorlib.dll</HintPath>
+      <HintPath>C:\Apps\Unity2017.4.3\Editor\Data\MonoBleedingEdge\lib\mono\4.6-api\mscorlib.dll</HintPath>
     </Reference>
     <Reference Include="System">
-      <HintPath>C:\Apps\Unity\Editor\Data\MonoBleedingEdge\lib\mono\4.6-api\System.dll</HintPath>
+      <HintPath>C:\Apps\Unity2017.4.3\Editor\Data\MonoBleedingEdge\lib\mono\4.6-api\System.dll</HintPath>
     </Reference>
     <Reference Include="System.XML">
-      <HintPath>C:\Apps\Unity\Editor\Data\MonoBleedingEdge\lib\mono\4.6-api\System.XML.dll</HintPath>
+      <HintPath>C:\Apps\Unity2017.4.3\Editor\Data\MonoBleedingEdge\lib\mono\4.6-api\System.XML.dll</HintPath>
     </Reference>
     <Reference Include="System.Core">
-      <HintPath>C:\Apps\Unity\Editor\Data\MonoBleedingEdge\lib\mono\4.6-api\System.Core.dll</HintPath>
+      <HintPath>C:\Apps\Unity2017.4.3\Editor\Data\MonoBleedingEdge\lib\mono\4.6-api\System.Core.dll</HintPath>
     </Reference>
     <Reference Include="Microsoft.CSharp">
-      <HintPath>C:\Apps\Unity\Editor\Data\MonoBleedingEdge\lib\mono\4.6-api\Microsoft.CSharp.dll</HintPath>
+      <HintPath>C:\Apps\Unity2017.4.3\Editor\Data\MonoBleedingEdge\lib\mono\4.6-api\Microsoft.CSharp.dll</HintPath>
     </Reference>
     <Reference Include="System.Runtime.Serialization">
-      <HintPath>C:\Apps\Unity\Editor\Data\MonoBleedingEdge\lib\mono\4.6-api\System.Runtime.Serialization.dll</HintPath>
+      <HintPath>C:\Apps\Unity2017.4.3\Editor\Data\MonoBleedingEdge\lib\mono\4.6-api\System.Runtime.Serialization.dll</HintPath>
     </Reference>
     <Reference Include="System.Xml.Linq">
-      <HintPath>C:\Apps\Unity\Editor\Data\MonoBleedingEdge\lib\mono\4.6-api\System.Xml.Linq.dll</HintPath>
+      <HintPath>C:\Apps\Unity2017.4.3\Editor\Data\MonoBleedingEdge\lib\mono\4.6-api\System.Xml.Linq.dll</HintPath>
     </Reference>
     <Reference Include="UnityEditor">
-      <HintPath>C:/Apps/Unity/Editor/Data/Managed/UnityEditor.dll</HintPath>
+      <HintPath>C:/Apps/Unity2017.4.3/Editor/Data/Managed/UnityEditor.dll</HintPath>
     </Reference>
     <Reference Include="UnityEngine">
-      <HintPath>C:/Apps/Unity/Editor/Data/Managed/UnityEngine/UnityEngine.dll</HintPath>
+      <HintPath>C:/Apps/Unity2017.4.3/Editor/Data/Managed/UnityEngine/UnityEngine.dll</HintPath>
     </Reference>
     <Reference Include="UnityEngine.CoreModule">
-      <HintPath>C:/Apps/Unity/Editor/Data/Managed/UnityEngine/UnityEngine.CoreModule.dll</HintPath>
+      <HintPath>C:/Apps/Unity2017.4.3/Editor/Data/Managed/UnityEngine/UnityEngine.CoreModule.dll</HintPath>
     </Reference>
     <Reference Include="UnityEngine.AccessibilityModule">
-      <HintPath>C:/Apps/Unity/Editor/Data/Managed/UnityEngine/UnityEngine.AccessibilityModule.dll</HintPath>
+      <HintPath>C:/Apps/Unity2017.4.3/Editor/Data/Managed/UnityEngine/UnityEngine.AccessibilityModule.dll</HintPath>
     </Reference>
     <Reference Include="UnityEngine.ParticleSystemModule">
-      <HintPath>C:/Apps/Unity/Editor/Data/Managed/UnityEngine/UnityEngine.ParticleSystemModule.dll</HintPath>
+      <HintPath>C:/Apps/Unity2017.4.3/Editor/Data/Managed/UnityEngine/UnityEngine.ParticleSystemModule.dll</HintPath>
     </Reference>
     <Reference Include="UnityEngine.PhysicsModule">
-      <HintPath>C:/Apps/Unity/Editor/Data/Managed/UnityEngine/UnityEngine.PhysicsModule.dll</HintPath>
+      <HintPath>C:/Apps/Unity2017.4.3/Editor/Data/Managed/UnityEngine/UnityEngine.PhysicsModule.dll</HintPath>
     </Reference>
     <Reference Include="UnityEngine.VehiclesModule">
-      <HintPath>C:/Apps/Unity/Editor/Data/Managed/UnityEngine/UnityEngine.VehiclesModule.dll</HintPath>
+      <HintPath>C:/Apps/Unity2017.4.3/Editor/Data/Managed/UnityEngine/UnityEngine.VehiclesModule.dll</HintPath>
     </Reference>
     <Reference Include="UnityEngine.ClothModule">
-      <HintPath>C:/Apps/Unity/Editor/Data/Managed/UnityEngine/UnityEngine.ClothModule.dll</HintPath>
+      <HintPath>C:/Apps/Unity2017.4.3/Editor/Data/Managed/UnityEngine/UnityEngine.ClothModule.dll</HintPath>
     </Reference>
     <Reference Include="UnityEngine.AIModule">
-      <HintPath>C:/Apps/Unity/Editor/Data/Managed/UnityEngine/UnityEngine.AIModule.dll</HintPath>
+      <HintPath>C:/Apps/Unity2017.4.3/Editor/Data/Managed/UnityEngine/UnityEngine.AIModule.dll</HintPath>
     </Reference>
     <Reference Include="UnityEngine.AnimationModule">
-      <HintPath>C:/Apps/Unity/Editor/Data/Managed/UnityEngine/UnityEngine.AnimationModule.dll</HintPath>
+      <HintPath>C:/Apps/Unity2017.4.3/Editor/Data/Managed/UnityEngine/UnityEngine.AnimationModule.dll</HintPath>
     </Reference>
     <Reference Include="UnityEngine.TextRenderingModule">
-      <HintPath>C:/Apps/Unity/Editor/Data/Managed/UnityEngine/UnityEngine.TextRenderingModule.dll</HintPath>
+      <HintPath>C:/Apps/Unity2017.4.3/Editor/Data/Managed/UnityEngine/UnityEngine.TextRenderingModule.dll</HintPath>
     </Reference>
     <Reference Include="UnityEngine.UIModule">
-      <HintPath>C:/Apps/Unity/Editor/Data/Managed/UnityEngine/UnityEngine.UIModule.dll</HintPath>
+      <HintPath>C:/Apps/Unity2017.4.3/Editor/Data/Managed/UnityEngine/UnityEngine.UIModule.dll</HintPath>
     </Reference>
     <Reference Include="UnityEngine.TerrainPhysicsModule">
-      <HintPath>C:/Apps/Unity/Editor/Data/Managed/UnityEngine/UnityEngine.TerrainPhysicsModule.dll</HintPath>
+      <HintPath>C:/Apps/Unity2017.4.3/Editor/Data/Managed/UnityEngine/UnityEngine.TerrainPhysicsModule.dll</HintPath>
     </Reference>
     <Reference Include="UnityEngine.IMGUIModule">
-      <HintPath>C:/Apps/Unity/Editor/Data/Managed/UnityEngine/UnityEngine.IMGUIModule.dll</HintPath>
+      <HintPath>C:/Apps/Unity2017.4.3/Editor/Data/Managed/UnityEngine/UnityEngine.IMGUIModule.dll</HintPath>
     </Reference>
     <Reference Include="UnityEngine.ClusterInputModule">
-      <HintPath>C:/Apps/Unity/Editor/Data/Managed/UnityEngine/UnityEngine.ClusterInputModule.dll</HintPath>
+      <HintPath>C:/Apps/Unity2017.4.3/Editor/Data/Managed/UnityEngine/UnityEngine.ClusterInputModule.dll</HintPath>
     </Reference>
     <Reference Include="UnityEngine.ClusterRendererModule">
-      <HintPath>C:/Apps/Unity/Editor/Data/Managed/UnityEngine/UnityEngine.ClusterRendererModule.dll</HintPath>
+      <HintPath>C:/Apps/Unity2017.4.3/Editor/Data/Managed/UnityEngine/UnityEngine.ClusterRendererModule.dll</HintPath>
     </Reference>
     <Reference Include="UnityEngine.UNETModule">
-      <HintPath>C:/Apps/Unity/Editor/Data/Managed/UnityEngine/UnityEngine.UNETModule.dll</HintPath>
+      <HintPath>C:/Apps/Unity2017.4.3/Editor/Data/Managed/UnityEngine/UnityEngine.UNETModule.dll</HintPath>
     </Reference>
     <Reference Include="UnityEngine.DirectorModule">
-      <HintPath>C:/Apps/Unity/Editor/Data/Managed/UnityEngine/UnityEngine.DirectorModule.dll</HintPath>
+      <HintPath>C:/Apps/Unity2017.4.3/Editor/Data/Managed/UnityEngine/UnityEngine.DirectorModule.dll</HintPath>
     </Reference>
     <Reference Include="UnityEngine.UnityAnalyticsModule">
-      <HintPath>C:/Apps/Unity/Editor/Data/Managed/UnityEngine/UnityEngine.UnityAnalyticsModule.dll</HintPath>
+      <HintPath>C:/Apps/Unity2017.4.3/Editor/Data/Managed/UnityEngine/UnityEngine.UnityAnalyticsModule.dll</HintPath>
     </Reference>
     <Reference Include="UnityEngine.PerformanceReportingModule">
-      <HintPath>C:/Apps/Unity/Editor/Data/Managed/UnityEngine/UnityEngine.PerformanceReportingModule.dll</HintPath>
+      <HintPath>C:/Apps/Unity2017.4.3/Editor/Data/Managed/UnityEngine/UnityEngine.PerformanceReportingModule.dll</HintPath>
     </Reference>
     <Reference Include="UnityEngine.UnityConnectModule">
-      <HintPath>C:/Apps/Unity/Editor/Data/Managed/UnityEngine/UnityEngine.UnityConnectModule.dll</HintPath>
+      <HintPath>C:/Apps/Unity2017.4.3/Editor/Data/Managed/UnityEngine/UnityEngine.UnityConnectModule.dll</HintPath>
     </Reference>
     <Reference Include="UnityEngine.WebModule">
-      <HintPath>C:/Apps/Unity/Editor/Data/Managed/UnityEngine/UnityEngine.WebModule.dll</HintPath>
+      <HintPath>C:/Apps/Unity2017.4.3/Editor/Data/Managed/UnityEngine/UnityEngine.WebModule.dll</HintPath>
     </Reference>
     <Reference Include="UnityEngine.ARModule">
-      <HintPath>C:/Apps/Unity/Editor/Data/Managed/UnityEngine/UnityEngine.ARModule.dll</HintPath>
+      <HintPath>C:/Apps/Unity2017.4.3/Editor/Data/Managed/UnityEngine/UnityEngine.ARModule.dll</HintPath>
     </Reference>
     <Reference Include="UnityEngine.VRModule">
-      <HintPath>C:/Apps/Unity/Editor/Data/Managed/UnityEngine/UnityEngine.VRModule.dll</HintPath>
+      <HintPath>C:/Apps/Unity2017.4.3/Editor/Data/Managed/UnityEngine/UnityEngine.VRModule.dll</HintPath>
     </Reference>
     <Reference Include="UnityEngine.UIElementsModule">
-      <HintPath>C:/Apps/Unity/Editor/Data/Managed/UnityEngine/UnityEngine.UIElementsModule.dll</HintPath>
+      <HintPath>C:/Apps/Unity2017.4.3/Editor/Data/Managed/UnityEngine/UnityEngine.UIElementsModule.dll</HintPath>
     </Reference>
     <Reference Include="UnityEngine.StyleSheetsModule">
-      <HintPath>C:/Apps/Unity/Editor/Data/Managed/UnityEngine/UnityEngine.StyleSheetsModule.dll</HintPath>
+      <HintPath>C:/Apps/Unity2017.4.3/Editor/Data/Managed/UnityEngine/UnityEngine.StyleSheetsModule.dll</HintPath>
     </Reference>
     <Reference Include="UnityEngine.AssetBundleModule">
-      <HintPath>C:/Apps/Unity/Editor/Data/Managed/UnityEngine/UnityEngine.AssetBundleModule.dll</HintPath>
+      <HintPath>C:/Apps/Unity2017.4.3/Editor/Data/Managed/UnityEngine/UnityEngine.AssetBundleModule.dll</HintPath>
     </Reference>
     <Reference Include="UnityEngine.AudioModule">
-      <HintPath>C:/Apps/Unity/Editor/Data/Managed/UnityEngine/UnityEngine.AudioModule.dll</HintPath>
+      <HintPath>C:/Apps/Unity2017.4.3/Editor/Data/Managed/UnityEngine/UnityEngine.AudioModule.dll</HintPath>
     </Reference>
     <Reference Include="UnityEngine.CrashReportingModule">
-      <HintPath>C:/Apps/Unity/Editor/Data/Managed/UnityEngine/UnityEngine.CrashReportingModule.dll</HintPath>
+      <HintPath>C:/Apps/Unity2017.4.3/Editor/Data/Managed/UnityEngine/UnityEngine.CrashReportingModule.dll</HintPath>
     </Reference>
     <Reference Include="UnityEngine.GameCenterModule">
-      <HintPath>C:/Apps/Unity/Editor/Data/Managed/UnityEngine/UnityEngine.GameCenterModule.dll</HintPath>
+      <HintPath>C:/Apps/Unity2017.4.3/Editor/Data/Managed/UnityEngine/UnityEngine.GameCenterModule.dll</HintPath>
     </Reference>
     <Reference Include="UnityEngine.GridModule">
-      <HintPath>C:/Apps/Unity/Editor/Data/Managed/UnityEngine/UnityEngine.GridModule.dll</HintPath>
+      <HintPath>C:/Apps/Unity2017.4.3/Editor/Data/Managed/UnityEngine/UnityEngine.GridModule.dll</HintPath>
     </Reference>
     <Reference Include="UnityEngine.ImageConversionModule">
-      <HintPath>C:/Apps/Unity/Editor/Data/Managed/UnityEngine/UnityEngine.ImageConversionModule.dll</HintPath>
+      <HintPath>C:/Apps/Unity2017.4.3/Editor/Data/Managed/UnityEngine/UnityEngine.ImageConversionModule.dll</HintPath>
     </Reference>
     <Reference Include="UnityEngine.InputModule">
-      <HintPath>C:/Apps/Unity/Editor/Data/Managed/UnityEngine/UnityEngine.InputModule.dll</HintPath>
+      <HintPath>C:/Apps/Unity2017.4.3/Editor/Data/Managed/UnityEngine/UnityEngine.InputModule.dll</HintPath>
     </Reference>
     <Reference Include="UnityEngine.JSONSerializeModule">
-      <HintPath>C:/Apps/Unity/Editor/Data/Managed/UnityEngine/UnityEngine.JSONSerializeModule.dll</HintPath>
+      <HintPath>C:/Apps/Unity2017.4.3/Editor/Data/Managed/UnityEngine/UnityEngine.JSONSerializeModule.dll</HintPath>
     </Reference>
     <Reference Include="UnityEngine.ParticlesLegacyModule">
-      <HintPath>C:/Apps/Unity/Editor/Data/Managed/UnityEngine/UnityEngine.ParticlesLegacyModule.dll</HintPath>
+      <HintPath>C:/Apps/Unity2017.4.3/Editor/Data/Managed/UnityEngine/UnityEngine.ParticlesLegacyModule.dll</HintPath>
     </Reference>
     <Reference Include="UnityEngine.Physics2DModule">
-      <HintPath>C:/Apps/Unity/Editor/Data/Managed/UnityEngine/UnityEngine.Physics2DModule.dll</HintPath>
+      <HintPath>C:/Apps/Unity2017.4.3/Editor/Data/Managed/UnityEngine/UnityEngine.Physics2DModule.dll</HintPath>
     </Reference>
     <Reference Include="UnityEngine.ScreenCaptureModule">
-      <HintPath>C:/Apps/Unity/Editor/Data/Managed/UnityEngine/UnityEngine.ScreenCaptureModule.dll</HintPath>
+      <HintPath>C:/Apps/Unity2017.4.3/Editor/Data/Managed/UnityEngine/UnityEngine.ScreenCaptureModule.dll</HintPath>
     </Reference>
     <Reference Include="UnityEngine.SharedInternalsModule">
-      <HintPath>C:/Apps/Unity/Editor/Data/Managed/UnityEngine/UnityEngine.SharedInternalsModule.dll</HintPath>
+      <HintPath>C:/Apps/Unity2017.4.3/Editor/Data/Managed/UnityEngine/UnityEngine.SharedInternalsModule.dll</HintPath>
     </Reference>
     <Reference Include="UnityEngine.SpriteMaskModule">
-      <HintPath>C:/Apps/Unity/Editor/Data/Managed/UnityEngine/UnityEngine.SpriteMaskModule.dll</HintPath>
+      <HintPath>C:/Apps/Unity2017.4.3/Editor/Data/Managed/UnityEngine/UnityEngine.SpriteMaskModule.dll</HintPath>
     </Reference>
     <Reference Include="UnityEngine.SpriteShapeModule">
-      <HintPath>C:/Apps/Unity/Editor/Data/Managed/UnityEngine/UnityEngine.SpriteShapeModule.dll</HintPath>
+      <HintPath>C:/Apps/Unity2017.4.3/Editor/Data/Managed/UnityEngine/UnityEngine.SpriteShapeModule.dll</HintPath>
     </Reference>
     <Reference Include="UnityEngine.TerrainModule">
-      <HintPath>C:/Apps/Unity/Editor/Data/Managed/UnityEngine/UnityEngine.TerrainModule.dll</HintPath>
+      <HintPath>C:/Apps/Unity2017.4.3/Editor/Data/Managed/UnityEngine/UnityEngine.TerrainModule.dll</HintPath>
     </Reference>
     <Reference Include="UnityEngine.TilemapModule">
-      <HintPath>C:/Apps/Unity/Editor/Data/Managed/UnityEngine/UnityEngine.TilemapModule.dll</HintPath>
+      <HintPath>C:/Apps/Unity2017.4.3/Editor/Data/Managed/UnityEngine/UnityEngine.TilemapModule.dll</HintPath>
     </Reference>
     <Reference Include="UnityEngine.UnityWebRequestModule">
-      <HintPath>C:/Apps/Unity/Editor/Data/Managed/UnityEngine/UnityEngine.UnityWebRequestModule.dll</HintPath>
+      <HintPath>C:/Apps/Unity2017.4.3/Editor/Data/Managed/UnityEngine/UnityEngine.UnityWebRequestModule.dll</HintPath>
     </Reference>
     <Reference Include="UnityEngine.UnityWebRequestAudioModule">
-      <HintPath>C:/Apps/Unity/Editor/Data/Managed/UnityEngine/UnityEngine.UnityWebRequestAudioModule.dll</HintPath>
+      <HintPath>C:/Apps/Unity2017.4.3/Editor/Data/Managed/UnityEngine/UnityEngine.UnityWebRequestAudioModule.dll</HintPath>
     </Reference>
     <Reference Include="UnityEngine.UnityWebRequestTextureModule">
-      <HintPath>C:/Apps/Unity/Editor/Data/Managed/UnityEngine/UnityEngine.UnityWebRequestTextureModule.dll</HintPath>
+      <HintPath>C:/Apps/Unity2017.4.3/Editor/Data/Managed/UnityEngine/UnityEngine.UnityWebRequestTextureModule.dll</HintPath>
     </Reference>
     <Reference Include="UnityEngine.UnityWebRequestWWWModule">
-      <HintPath>C:/Apps/Unity/Editor/Data/Managed/UnityEngine/UnityEngine.UnityWebRequestWWWModule.dll</HintPath>
+      <HintPath>C:/Apps/Unity2017.4.3/Editor/Data/Managed/UnityEngine/UnityEngine.UnityWebRequestWWWModule.dll</HintPath>
     </Reference>
     <Reference Include="UnityEngine.VideoModule">
-      <HintPath>C:/Apps/Unity/Editor/Data/Managed/UnityEngine/UnityEngine.VideoModule.dll</HintPath>
+      <HintPath>C:/Apps/Unity2017.4.3/Editor/Data/Managed/UnityEngine/UnityEngine.VideoModule.dll</HintPath>
     </Reference>
     <Reference Include="UnityEngine.WindModule">
-      <HintPath>C:/Apps/Unity/Editor/Data/Managed/UnityEngine/UnityEngine.WindModule.dll</HintPath>
+      <HintPath>C:/Apps/Unity2017.4.3/Editor/Data/Managed/UnityEngine/UnityEngine.WindModule.dll</HintPath>
     </Reference>
     <Reference Include="UnityEngine.UI">
-      <HintPath>C:/Apps/Unity/Editor/Data/UnityExtensions/Unity/GUISystem/UnityEngine.UI.dll</HintPath>
+      <HintPath>C:/Apps/Unity2017.4.3/Editor/Data/UnityExtensions/Unity/GUISystem/UnityEngine.UI.dll</HintPath>
     </Reference>
     <Reference Include="UnityEditor.UI">
-      <HintPath>C:/Apps/Unity/Editor/Data/UnityExtensions/Unity/GUISystem/Editor/UnityEditor.UI.dll</HintPath>
+      <HintPath>C:/Apps/Unity2017.4.3/Editor/Data/UnityExtensions/Unity/GUISystem/Editor/UnityEditor.UI.dll</HintPath>
     </Reference>
     <Reference Include="UnityEngine.Networking">
-      <HintPath>C:/Apps/Unity/Editor/Data/UnityExtensions/Unity/Networking/UnityEngine.Networking.dll</HintPath>
+      <HintPath>C:/Apps/Unity2017.4.3/Editor/Data/UnityExtensions/Unity/Networking/UnityEngine.Networking.dll</HintPath>
     </Reference>
     <Reference Include="UnityEditor.Networking">
-      <HintPath>C:/Apps/Unity/Editor/Data/UnityExtensions/Unity/Networking/Editor/UnityEditor.Networking.dll</HintPath>
+      <HintPath>C:/Apps/Unity2017.4.3/Editor/Data/UnityExtensions/Unity/Networking/Editor/UnityEditor.Networking.dll</HintPath>
     </Reference>
     <Reference Include="UnityEditor.TestRunner">
-      <HintPath>C:/Apps/Unity/Editor/Data/UnityExtensions/Unity/TestRunner/Editor/UnityEditor.TestRunner.dll</HintPath>
+      <HintPath>C:/Apps/Unity2017.4.3/Editor/Data/UnityExtensions/Unity/TestRunner/Editor/UnityEditor.TestRunner.dll</HintPath>
     </Reference>
     <Reference Include="UnityEngine.TestRunner">
-      <HintPath>C:/Apps/Unity/Editor/Data/UnityExtensions/Unity/TestRunner/UnityEngine.TestRunner.dll</HintPath>
+      <HintPath>C:/Apps/Unity2017.4.3/Editor/Data/UnityExtensions/Unity/TestRunner/UnityEngine.TestRunner.dll</HintPath>
     </Reference>
     <Reference Include="nunit.framework">
-      <HintPath>C:/Apps/Unity/Editor/Data/UnityExtensions/Unity/TestRunner/net35/unity-custom/nunit.framework.dll</HintPath>
+      <HintPath>C:/Apps/Unity2017.4.3/Editor/Data/UnityExtensions/Unity/TestRunner/net35/unity-custom/nunit.framework.dll</HintPath>
     </Reference>
     <Reference Include="UnityEngine.Timeline">
-      <HintPath>C:/Apps/Unity/Editor/Data/UnityExtensions/Unity/Timeline/RuntimeEditor/UnityEngine.Timeline.dll</HintPath>
+      <HintPath>C:/Apps/Unity2017.4.3/Editor/Data/UnityExtensions/Unity/Timeline/RuntimeEditor/UnityEngine.Timeline.dll</HintPath>
     </Reference>
     <Reference Include="UnityEditor.Timeline">
-      <HintPath>C:/Apps/Unity/Editor/Data/UnityExtensions/Unity/Timeline/Editor/UnityEditor.Timeline.dll</HintPath>
+      <HintPath>C:/Apps/Unity2017.4.3/Editor/Data/UnityExtensions/Unity/Timeline/Editor/UnityEditor.Timeline.dll</HintPath>
     </Reference>
     <Reference Include="UnityEditor.TreeEditor">
-      <HintPath>C:/Apps/Unity/Editor/Data/UnityExtensions/Unity/TreeEditor/Editor/UnityEditor.TreeEditor.dll</HintPath>
+      <HintPath>C:/Apps/Unity2017.4.3/Editor/Data/UnityExtensions/Unity/TreeEditor/Editor/UnityEditor.TreeEditor.dll</HintPath>
     </Reference>
     <Reference Include="UnityEngine.UIAutomation">
-      <HintPath>C:/Apps/Unity/Editor/Data/UnityExtensions/Unity/UIAutomation/UnityEngine.UIAutomation.dll</HintPath>
+      <HintPath>C:/Apps/Unity2017.4.3/Editor/Data/UnityExtensions/Unity/UIAutomation/UnityEngine.UIAutomation.dll</HintPath>
     </Reference>
     <Reference Include="UnityEditor.UIAutomation">
-      <HintPath>C:/Apps/Unity/Editor/Data/UnityExtensions/Unity/UIAutomation/Editor/UnityEditor.UIAutomation.dll</HintPath>
+      <HintPath>C:/Apps/Unity2017.4.3/Editor/Data/UnityExtensions/Unity/UIAutomation/Editor/UnityEditor.UIAutomation.dll</HintPath>
     </Reference>
     <Reference Include="UnityEditor.GoogleAudioSpatializer">
-      <HintPath>C:/Apps/Unity/Editor/Data/UnityExtensions/Unity/UnityGoogleAudioSpatializer/Editor/UnityEditor.GoogleAudioSpatializer.dll</HintPath>
+      <HintPath>C:/Apps/Unity2017.4.3/Editor/Data/UnityExtensions/Unity/UnityGoogleAudioSpatializer/Editor/UnityEditor.GoogleAudioSpatializer.dll</HintPath>
     </Reference>
     <Reference Include="UnityEngine.GoogleAudioSpatializer">
-      <HintPath>C:/Apps/Unity/Editor/Data/UnityExtensions/Unity/UnityGoogleAudioSpatializer/RuntimeEditor/UnityEngine.GoogleAudioSpatializer.dll</HintPath>
+      <HintPath>C:/Apps/Unity2017.4.3/Editor/Data/UnityExtensions/Unity/UnityGoogleAudioSpatializer/RuntimeEditor/UnityEngine.GoogleAudioSpatializer.dll</HintPath>
     </Reference>
     <Reference Include="UnityEditor.HoloLens">
-      <HintPath>C:/Apps/Unity/Editor/Data/UnityExtensions/Unity/UnityHoloLens/Editor/UnityEditor.HoloLens.dll</HintPath>
+      <HintPath>C:/Apps/Unity2017.4.3/Editor/Data/UnityExtensions/Unity/UnityHoloLens/Editor/UnityEditor.HoloLens.dll</HintPath>
     </Reference>
     <Reference Include="UnityEngine.HoloLens">
-      <HintPath>C:/Apps/Unity/Editor/Data/UnityExtensions/Unity/UnityHoloLens/RuntimeEditor/UnityEngine.HoloLens.dll</HintPath>
+      <HintPath>C:/Apps/Unity2017.4.3/Editor/Data/UnityExtensions/Unity/UnityHoloLens/RuntimeEditor/UnityEngine.HoloLens.dll</HintPath>
     </Reference>
     <Reference Include="UnityEditor.SpatialTracking">
-      <HintPath>C:/Apps/Unity/Editor/Data/UnityExtensions/Unity/UnitySpatialTracking/Editor/UnityEditor.SpatialTracking.dll</HintPath>
+      <HintPath>C:/Apps/Unity2017.4.3/Editor/Data/UnityExtensions/Unity/UnitySpatialTracking/Editor/UnityEditor.SpatialTracking.dll</HintPath>
     </Reference>
     <Reference Include="UnityEngine.SpatialTracking">
-      <HintPath>C:/Apps/Unity/Editor/Data/UnityExtensions/Unity/UnitySpatialTracking/RuntimeEditor/UnityEngine.SpatialTracking.dll</HintPath>
+      <HintPath>C:/Apps/Unity2017.4.3/Editor/Data/UnityExtensions/Unity/UnitySpatialTracking/RuntimeEditor/UnityEngine.SpatialTracking.dll</HintPath>
     </Reference>
     <Reference Include="UnityEditor.VR">
-      <HintPath>C:/Apps/Unity/Editor/Data/UnityExtensions/Unity/UnityVR/Editor/UnityEditor.VR.dll</HintPath>
+      <HintPath>C:/Apps/Unity2017.4.3/Editor/Data/UnityExtensions/Unity/UnityVR/Editor/UnityEditor.VR.dll</HintPath>
     </Reference>
     <Reference Include="UnityEditor.Graphs">
-      <HintPath>C:/Apps/Unity/Editor/Data/Managed/UnityEditor.Graphs.dll</HintPath>
+      <HintPath>C:/Apps/Unity2017.4.3/Editor/Data/Managed/UnityEditor.Graphs.dll</HintPath>
     </Reference>
     <Reference Include="UnityEditor.Android.Extensions">
-      <HintPath>C:/Apps/Unity/Editor/Data/PlaybackEngines/AndroidPlayer/UnityEditor.Android.Extensions.dll</HintPath>
+      <HintPath>C:/Apps/Unity2017.4.3/Editor/Data/PlaybackEngines/AndroidPlayer/UnityEditor.Android.Extensions.dll</HintPath>
     </Reference>
     <Reference Include="UnityEditor.WindowsStandalone.Extensions">
-      <HintPath>C:/Apps/Unity/Editor/Data/PlaybackEngines/windowsstandalonesupport/UnityEditor.WindowsStandalone.Extensions.dll</HintPath>
+      <HintPath>C:/Apps/Unity2017.4.3/Editor/Data/PlaybackEngines/windowsstandalonesupport/UnityEditor.WindowsStandalone.Extensions.dll</HintPath>
     </Reference>
     <Reference Include="SyntaxTree.VisualStudio.Unity.Bridge">
       <HintPath>C:/Program Files (x86)/Microsoft Visual Studio Tools for Unity/15.0/Editor/SyntaxTree.VisualStudio.Unity.Bridge.dll</HintPath>
@@ -300,22 +300,22 @@
       <HintPath>Assets/Plugins/Editor/npoi/NPOI.OpenXmlFormats.dll</HintPath>
     </Reference>
     <Reference Include="UnityEditor.Advertisements">
-      <HintPath>C:/Users/tanghai/AppData/Local/Unity/cache/packages/packages.unity.com/com.unity.ads@2.0.8/Editor/UnityEditor.Advertisements.dll</HintPath>
+      <HintPath>C:/Users/USER-PC/AppData/Local/Unity/cache/packages/packages.unity.com/com.unity.ads@2.0.8/Editor/UnityEditor.Advertisements.dll</HintPath>
     </Reference>
     <Reference Include="UnityEngine.Analytics">
-      <HintPath>C:/Users/tanghai/AppData/Local/Unity/cache/packages/packages.unity.com/com.unity.analytics@2.0.13/UnityEngine.Analytics.dll</HintPath>
+      <HintPath>C:/Users/USER-PC/AppData/Local/Unity/cache/packages/packages.unity.com/com.unity.analytics@2.0.13/UnityEngine.Analytics.dll</HintPath>
     </Reference>
     <Reference Include="UnityEditor.Analytics">
-      <HintPath>C:/Users/tanghai/AppData/Local/Unity/cache/packages/packages.unity.com/com.unity.analytics@2.0.13/Editor/UnityEditor.Analytics.dll</HintPath>
+      <HintPath>C:/Users/USER-PC/AppData/Local/Unity/cache/packages/packages.unity.com/com.unity.analytics@2.0.13/Editor/UnityEditor.Analytics.dll</HintPath>
     </Reference>
     <Reference Include="UnityEngine.Purchasing">
-      <HintPath>C:/Users/tanghai/AppData/Local/Unity/cache/packages/packages.unity.com/com.unity.purchasing@0.0.19/UnityEngine.Purchasing.dll</HintPath>
+      <HintPath>C:/Users/USER-PC/AppData/Local/Unity/cache/packages/packages.unity.com/com.unity.purchasing@0.0.19/UnityEngine.Purchasing.dll</HintPath>
     </Reference>
     <Reference Include="UnityEditor.Purchasing">
-      <HintPath>C:/Users/tanghai/AppData/Local/Unity/cache/packages/packages.unity.com/com.unity.purchasing@0.0.19/Editor/UnityEditor.Purchasing.dll</HintPath>
+      <HintPath>C:/Users/USER-PC/AppData/Local/Unity/cache/packages/packages.unity.com/com.unity.purchasing@0.0.19/Editor/UnityEditor.Purchasing.dll</HintPath>
     </Reference>
     <Reference Include="UnityEngine.StandardEvents">
-      <HintPath>C:/Users/tanghai/AppData/Local/Unity/cache/packages/packages.unity.com/com.unity.standardevents@1.0.10/UnityEngine.StandardEvents.dll</HintPath>
+      <HintPath>C:/Users/USER-PC/AppData/Local/Unity/cache/packages/packages.unity.com/com.unity.standardevents@1.0.10/UnityEngine.StandardEvents.dll</HintPath>
     </Reference>
   </ItemGroup>
   <ItemGroup>

+ 86 - 86
Unity/Unity.Editor.csproj

@@ -16,7 +16,7 @@
     <CompilerResponseFile></CompilerResponseFile>
     <UnityProjectGenerator>VSTU</UnityProjectGenerator>
     <UnityProjectType>Editor:5</UnityProjectType>
-    <UnityBuildTarget>StandaloneWindows64:19</UnityBuildTarget>
+    <UnityBuildTarget>StandaloneWindows:5</UnityBuildTarget>
     <UnityVersion>2017.4.3f1</UnityVersion>
     <RootNamespace></RootNamespace>
     <LangVersion>6</LangVersion>
@@ -33,7 +33,7 @@
     <IntermediateOutputPath>Temp\UnityVS_obj\Debug\</IntermediateOutputPath>
     <ErrorReport>prompt</ErrorReport>
     <WarningLevel>4</WarningLevel>
-    <DefineConstants>DEBUG;TRACE;UNITY_5_3_OR_NEWER;UNITY_5_4_OR_NEWER;UNITY_5_5_OR_NEWER;UNITY_5_6_OR_NEWER;UNITY_2017_1_OR_NEWER;UNITY_2017_2_OR_NEWER;UNITY_2017_3_OR_NEWER;UNITY_2017_4_OR_NEWER;UNITY_2017_4_3;UNITY_2017_4;UNITY_2017;PLATFORM_ARCH_64;UNITY_64;ENABLE_AUDIO;ENABLE_CACHING;ENABLE_CLOTH;ENABLE_DUCK_TYPING;ENABLE_GENERICS;ENABLE_PVR_GI;ENABLE_MICROPHONE;ENABLE_MULTIPLE_DISPLAYS;ENABLE_PHYSICS;ENABLE_SPRITERENDERER_FLIPPING;ENABLE_SPRITES;ENABLE_GRID;ENABLE_TILEMAP;ENABLE_TERRAIN;ENABLE_RAKNET;ENABLE_DIRECTOR;ENABLE_UNET;ENABLE_LZMA;ENABLE_UNITYEVENTS;ENABLE_WEBCAM;ENABLE_WWW;ENABLE_CLOUD_SERVICES_COLLAB;ENABLE_CLOUD_SERVICES_COLLAB_SOFTLOCKS;ENABLE_CLOUD_SERVICES_ADS;ENABLE_CLOUD_HUB;ENABLE_CLOUD_PROJECT_ID;ENABLE_CLOUD_SERVICES_USE_WEBREQUEST;ENABLE_CLOUD_SERVICES_UNET;ENABLE_CLOUD_SERVICES_BUILD;ENABLE_CLOUD_LICENSE;ENABLE_EDITOR_HUB;ENABLE_EDITOR_HUB_LICENSE;ENABLE_WEBSOCKET_CLIENT;ENABLE_DIRECTOR_AUDIO;ENABLE_DIRECTOR_TEXTURE;ENABLE_TIMELINE;ENABLE_EDITOR_METRICS;ENABLE_EDITOR_METRICS_CACHING;ENABLE_NATIVE_ARRAY;ENABLE_SPRITE_MASKING;INCLUDE_DYNAMIC_GI;INCLUDE_GI;ENABLE_MONO_BDWGC;PLATFORM_SUPPORTS_MONO;RENDER_SOFTWARE_CURSOR;INCLUDE_PUBNUB;ENABLE_PLAYMODE_TESTS_RUNNER;ENABLE_VIDEO;ENABLE_RMGUI;ENABLE_PACKMAN;ENABLE_CUSTOM_RENDER_TEXTURE;ENABLE_STYLE_SHEETS;ENABLE_LOCALIZATION;PLATFORM_STANDALONE_WIN;PLATFORM_STANDALONE;UNITY_STANDALONE_WIN;UNITY_STANDALONE;ENABLE_SUBSTANCE;ENABLE_RUNTIME_GI;ENABLE_MOVIES;ENABLE_NETWORK;ENABLE_CRUNCH_TEXTURE_COMPRESSION;ENABLE_UNITYWEBREQUEST;ENABLE_CLOUD_SERVICES;ENABLE_CLOUD_SERVICES_ANALYTICS;ENABLE_CLOUD_SERVICES_PURCHASING;ENABLE_CLOUD_SERVICES_CRASH_REPORTING;ENABLE_EVENT_QUEUE;ENABLE_CLUSTERINPUT;ENABLE_VR;ENABLE_AR;ENABLE_WEBSOCKET_HOST;ENABLE_MONO;NET_4_6;ENABLE_PROFILER;DEBUG;TRACE;UNITY_ASSERTIONS;UNITY_EDITOR;UNITY_EDITOR_64;UNITY_EDITOR_WIN;ENABLE_NATIVE_ARRAY_CHECKS;UNITY_TEAM_LICENSE;ENABLE_VSTU;UNITY_PRO_LICENSE;NET45;ILRuntime</DefineConstants>
+    <DefineConstants>DEBUG;TRACE;UNITY_5_3_OR_NEWER;UNITY_5_4_OR_NEWER;UNITY_5_5_OR_NEWER;UNITY_5_6_OR_NEWER;UNITY_2017_1_OR_NEWER;UNITY_2017_2_OR_NEWER;UNITY_2017_3_OR_NEWER;UNITY_2017_4_OR_NEWER;UNITY_2017_4_3;UNITY_2017_4;UNITY_2017;ENABLE_AUDIO;ENABLE_CACHING;ENABLE_CLOTH;ENABLE_DUCK_TYPING;ENABLE_GENERICS;ENABLE_PVR_GI;ENABLE_MICROPHONE;ENABLE_MULTIPLE_DISPLAYS;ENABLE_PHYSICS;ENABLE_SPRITERENDERER_FLIPPING;ENABLE_SPRITES;ENABLE_GRID;ENABLE_TILEMAP;ENABLE_TERRAIN;ENABLE_RAKNET;ENABLE_DIRECTOR;ENABLE_UNET;ENABLE_LZMA;ENABLE_UNITYEVENTS;ENABLE_WEBCAM;ENABLE_WWW;ENABLE_CLOUD_SERVICES_COLLAB;ENABLE_CLOUD_SERVICES_COLLAB_SOFTLOCKS;ENABLE_CLOUD_SERVICES_ADS;ENABLE_CLOUD_HUB;ENABLE_CLOUD_PROJECT_ID;ENABLE_CLOUD_SERVICES_USE_WEBREQUEST;ENABLE_CLOUD_SERVICES_UNET;ENABLE_CLOUD_SERVICES_BUILD;ENABLE_CLOUD_LICENSE;ENABLE_EDITOR_HUB;ENABLE_EDITOR_HUB_LICENSE;ENABLE_WEBSOCKET_CLIENT;ENABLE_DIRECTOR_AUDIO;ENABLE_DIRECTOR_TEXTURE;ENABLE_TIMELINE;ENABLE_EDITOR_METRICS;ENABLE_EDITOR_METRICS_CACHING;ENABLE_NATIVE_ARRAY;ENABLE_SPRITE_MASKING;INCLUDE_DYNAMIC_GI;INCLUDE_GI;ENABLE_MONO_BDWGC;PLATFORM_SUPPORTS_MONO;RENDER_SOFTWARE_CURSOR;INCLUDE_PUBNUB;ENABLE_PLAYMODE_TESTS_RUNNER;ENABLE_VIDEO;ENABLE_RMGUI;ENABLE_PACKMAN;ENABLE_CUSTOM_RENDER_TEXTURE;ENABLE_STYLE_SHEETS;ENABLE_LOCALIZATION;PLATFORM_STANDALONE_WIN;PLATFORM_STANDALONE;UNITY_STANDALONE_WIN;UNITY_STANDALONE;ENABLE_SUBSTANCE;ENABLE_RUNTIME_GI;ENABLE_MOVIES;ENABLE_NETWORK;ENABLE_CRUNCH_TEXTURE_COMPRESSION;ENABLE_UNITYWEBREQUEST;ENABLE_CLOUD_SERVICES;ENABLE_CLOUD_SERVICES_ANALYTICS;ENABLE_CLOUD_SERVICES_PURCHASING;ENABLE_CLOUD_SERVICES_CRASH_REPORTING;ENABLE_EVENT_QUEUE;ENABLE_CLUSTERINPUT;ENABLE_VR;ENABLE_AR;ENABLE_WEBSOCKET_HOST;ENABLE_MONO;NET_4_6;ENABLE_PROFILER;DEBUG;TRACE;UNITY_ASSERTIONS;UNITY_EDITOR;UNITY_EDITOR_64;UNITY_EDITOR_WIN;ENABLE_NATIVE_ARRAY_CHECKS;UNITY_TEAM_LICENSE;ENABLE_VSTU;UNITY_PRO_LICENSE;NET45;ILRuntime1</DefineConstants>
     <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
   </PropertyGroup>
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
@@ -43,240 +43,240 @@
     <IntermediateOutputPath>Temp\UnityVS_obj\Release\</IntermediateOutputPath>
     <ErrorReport>prompt</ErrorReport>
     <WarningLevel>4</WarningLevel>
-    <DefineConstants>TRACE;UNITY_5_3_OR_NEWER;UNITY_5_4_OR_NEWER;UNITY_5_5_OR_NEWER;UNITY_5_6_OR_NEWER;UNITY_2017_1_OR_NEWER;UNITY_2017_2_OR_NEWER;UNITY_2017_3_OR_NEWER;UNITY_2017_4_OR_NEWER;UNITY_2017_4_3;UNITY_2017_4;UNITY_2017;PLATFORM_ARCH_64;UNITY_64;ENABLE_AUDIO;ENABLE_CACHING;ENABLE_CLOTH;ENABLE_DUCK_TYPING;ENABLE_GENERICS;ENABLE_PVR_GI;ENABLE_MICROPHONE;ENABLE_MULTIPLE_DISPLAYS;ENABLE_PHYSICS;ENABLE_SPRITERENDERER_FLIPPING;ENABLE_SPRITES;ENABLE_GRID;ENABLE_TILEMAP;ENABLE_TERRAIN;ENABLE_RAKNET;ENABLE_DIRECTOR;ENABLE_UNET;ENABLE_LZMA;ENABLE_UNITYEVENTS;ENABLE_WEBCAM;ENABLE_WWW;ENABLE_CLOUD_SERVICES_COLLAB;ENABLE_CLOUD_SERVICES_COLLAB_SOFTLOCKS;ENABLE_CLOUD_SERVICES_ADS;ENABLE_CLOUD_HUB;ENABLE_CLOUD_PROJECT_ID;ENABLE_CLOUD_SERVICES_USE_WEBREQUEST;ENABLE_CLOUD_SERVICES_UNET;ENABLE_CLOUD_SERVICES_BUILD;ENABLE_CLOUD_LICENSE;ENABLE_EDITOR_HUB;ENABLE_EDITOR_HUB_LICENSE;ENABLE_WEBSOCKET_CLIENT;ENABLE_DIRECTOR_AUDIO;ENABLE_DIRECTOR_TEXTURE;ENABLE_TIMELINE;ENABLE_EDITOR_METRICS;ENABLE_EDITOR_METRICS_CACHING;ENABLE_NATIVE_ARRAY;ENABLE_SPRITE_MASKING;INCLUDE_DYNAMIC_GI;INCLUDE_GI;ENABLE_MONO_BDWGC;PLATFORM_SUPPORTS_MONO;RENDER_SOFTWARE_CURSOR;INCLUDE_PUBNUB;ENABLE_PLAYMODE_TESTS_RUNNER;ENABLE_VIDEO;ENABLE_RMGUI;ENABLE_PACKMAN;ENABLE_CUSTOM_RENDER_TEXTURE;ENABLE_STYLE_SHEETS;ENABLE_LOCALIZATION;PLATFORM_STANDALONE_WIN;PLATFORM_STANDALONE;UNITY_STANDALONE_WIN;UNITY_STANDALONE;ENABLE_SUBSTANCE;ENABLE_RUNTIME_GI;ENABLE_MOVIES;ENABLE_NETWORK;ENABLE_CRUNCH_TEXTURE_COMPRESSION;ENABLE_UNITYWEBREQUEST;ENABLE_CLOUD_SERVICES;ENABLE_CLOUD_SERVICES_ANALYTICS;ENABLE_CLOUD_SERVICES_PURCHASING;ENABLE_CLOUD_SERVICES_CRASH_REPORTING;ENABLE_EVENT_QUEUE;ENABLE_CLUSTERINPUT;ENABLE_VR;ENABLE_AR;ENABLE_WEBSOCKET_HOST;ENABLE_MONO;NET_4_6;ENABLE_PROFILER;DEBUG;TRACE;UNITY_ASSERTIONS;UNITY_EDITOR;UNITY_EDITOR_64;UNITY_EDITOR_WIN;ENABLE_NATIVE_ARRAY_CHECKS;UNITY_TEAM_LICENSE;ENABLE_VSTU;UNITY_PRO_LICENSE;NET45;ILRuntime</DefineConstants>
+    <DefineConstants>TRACE;UNITY_5_3_OR_NEWER;UNITY_5_4_OR_NEWER;UNITY_5_5_OR_NEWER;UNITY_5_6_OR_NEWER;UNITY_2017_1_OR_NEWER;UNITY_2017_2_OR_NEWER;UNITY_2017_3_OR_NEWER;UNITY_2017_4_OR_NEWER;UNITY_2017_4_3;UNITY_2017_4;UNITY_2017;ENABLE_AUDIO;ENABLE_CACHING;ENABLE_CLOTH;ENABLE_DUCK_TYPING;ENABLE_GENERICS;ENABLE_PVR_GI;ENABLE_MICROPHONE;ENABLE_MULTIPLE_DISPLAYS;ENABLE_PHYSICS;ENABLE_SPRITERENDERER_FLIPPING;ENABLE_SPRITES;ENABLE_GRID;ENABLE_TILEMAP;ENABLE_TERRAIN;ENABLE_RAKNET;ENABLE_DIRECTOR;ENABLE_UNET;ENABLE_LZMA;ENABLE_UNITYEVENTS;ENABLE_WEBCAM;ENABLE_WWW;ENABLE_CLOUD_SERVICES_COLLAB;ENABLE_CLOUD_SERVICES_COLLAB_SOFTLOCKS;ENABLE_CLOUD_SERVICES_ADS;ENABLE_CLOUD_HUB;ENABLE_CLOUD_PROJECT_ID;ENABLE_CLOUD_SERVICES_USE_WEBREQUEST;ENABLE_CLOUD_SERVICES_UNET;ENABLE_CLOUD_SERVICES_BUILD;ENABLE_CLOUD_LICENSE;ENABLE_EDITOR_HUB;ENABLE_EDITOR_HUB_LICENSE;ENABLE_WEBSOCKET_CLIENT;ENABLE_DIRECTOR_AUDIO;ENABLE_DIRECTOR_TEXTURE;ENABLE_TIMELINE;ENABLE_EDITOR_METRICS;ENABLE_EDITOR_METRICS_CACHING;ENABLE_NATIVE_ARRAY;ENABLE_SPRITE_MASKING;INCLUDE_DYNAMIC_GI;INCLUDE_GI;ENABLE_MONO_BDWGC;PLATFORM_SUPPORTS_MONO;RENDER_SOFTWARE_CURSOR;INCLUDE_PUBNUB;ENABLE_PLAYMODE_TESTS_RUNNER;ENABLE_VIDEO;ENABLE_RMGUI;ENABLE_PACKMAN;ENABLE_CUSTOM_RENDER_TEXTURE;ENABLE_STYLE_SHEETS;ENABLE_LOCALIZATION;PLATFORM_STANDALONE_WIN;PLATFORM_STANDALONE;UNITY_STANDALONE_WIN;UNITY_STANDALONE;ENABLE_SUBSTANCE;ENABLE_RUNTIME_GI;ENABLE_MOVIES;ENABLE_NETWORK;ENABLE_CRUNCH_TEXTURE_COMPRESSION;ENABLE_UNITYWEBREQUEST;ENABLE_CLOUD_SERVICES;ENABLE_CLOUD_SERVICES_ANALYTICS;ENABLE_CLOUD_SERVICES_PURCHASING;ENABLE_CLOUD_SERVICES_CRASH_REPORTING;ENABLE_EVENT_QUEUE;ENABLE_CLUSTERINPUT;ENABLE_VR;ENABLE_AR;ENABLE_WEBSOCKET_HOST;ENABLE_MONO;NET_4_6;ENABLE_PROFILER;DEBUG;TRACE;UNITY_ASSERTIONS;UNITY_EDITOR;UNITY_EDITOR_64;UNITY_EDITOR_WIN;ENABLE_NATIVE_ARRAY_CHECKS;UNITY_TEAM_LICENSE;ENABLE_VSTU;UNITY_PRO_LICENSE;NET45;ILRuntime1</DefineConstants>
     <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
   </PropertyGroup>
   <ItemGroup>
     <Reference Include="mscorlib">
-      <HintPath>C:\Apps\Unity\Editor\Data\MonoBleedingEdge\lib\mono\4.6-api\mscorlib.dll</HintPath>
+      <HintPath>C:\Apps\Unity2017.4.3\Editor\Data\MonoBleedingEdge\lib\mono\4.6-api\mscorlib.dll</HintPath>
     </Reference>
     <Reference Include="System">
-      <HintPath>C:\Apps\Unity\Editor\Data\MonoBleedingEdge\lib\mono\4.6-api\System.dll</HintPath>
+      <HintPath>C:\Apps\Unity2017.4.3\Editor\Data\MonoBleedingEdge\lib\mono\4.6-api\System.dll</HintPath>
     </Reference>
     <Reference Include="System.XML">
-      <HintPath>C:\Apps\Unity\Editor\Data\MonoBleedingEdge\lib\mono\4.6-api\System.XML.dll</HintPath>
+      <HintPath>C:\Apps\Unity2017.4.3\Editor\Data\MonoBleedingEdge\lib\mono\4.6-api\System.XML.dll</HintPath>
     </Reference>
     <Reference Include="System.Core">
-      <HintPath>C:\Apps\Unity\Editor\Data\MonoBleedingEdge\lib\mono\4.6-api\System.Core.dll</HintPath>
+      <HintPath>C:\Apps\Unity2017.4.3\Editor\Data\MonoBleedingEdge\lib\mono\4.6-api\System.Core.dll</HintPath>
     </Reference>
     <Reference Include="Microsoft.CSharp">
-      <HintPath>C:\Apps\Unity\Editor\Data\MonoBleedingEdge\lib\mono\4.6-api\Microsoft.CSharp.dll</HintPath>
+      <HintPath>C:\Apps\Unity2017.4.3\Editor\Data\MonoBleedingEdge\lib\mono\4.6-api\Microsoft.CSharp.dll</HintPath>
     </Reference>
     <Reference Include="System.Runtime.Serialization">
-      <HintPath>C:\Apps\Unity\Editor\Data\MonoBleedingEdge\lib\mono\4.6-api\System.Runtime.Serialization.dll</HintPath>
+      <HintPath>C:\Apps\Unity2017.4.3\Editor\Data\MonoBleedingEdge\lib\mono\4.6-api\System.Runtime.Serialization.dll</HintPath>
     </Reference>
     <Reference Include="System.Xml.Linq">
-      <HintPath>C:\Apps\Unity\Editor\Data\MonoBleedingEdge\lib\mono\4.6-api\System.Xml.Linq.dll</HintPath>
+      <HintPath>C:\Apps\Unity2017.4.3\Editor\Data\MonoBleedingEdge\lib\mono\4.6-api\System.Xml.Linq.dll</HintPath>
     </Reference>
     <Reference Include="UnityEditor">
-      <HintPath>C:/Apps/Unity/Editor/Data/Managed/UnityEditor.dll</HintPath>
+      <HintPath>C:/Apps/Unity2017.4.3/Editor/Data/Managed/UnityEditor.dll</HintPath>
     </Reference>
     <Reference Include="UnityEngine">
-      <HintPath>C:/Apps/Unity/Editor/Data/Managed/UnityEngine/UnityEngine.dll</HintPath>
+      <HintPath>C:/Apps/Unity2017.4.3/Editor/Data/Managed/UnityEngine/UnityEngine.dll</HintPath>
     </Reference>
     <Reference Include="UnityEngine.CoreModule">
-      <HintPath>C:/Apps/Unity/Editor/Data/Managed/UnityEngine/UnityEngine.CoreModule.dll</HintPath>
+      <HintPath>C:/Apps/Unity2017.4.3/Editor/Data/Managed/UnityEngine/UnityEngine.CoreModule.dll</HintPath>
     </Reference>
     <Reference Include="UnityEngine.AccessibilityModule">
-      <HintPath>C:/Apps/Unity/Editor/Data/Managed/UnityEngine/UnityEngine.AccessibilityModule.dll</HintPath>
+      <HintPath>C:/Apps/Unity2017.4.3/Editor/Data/Managed/UnityEngine/UnityEngine.AccessibilityModule.dll</HintPath>
     </Reference>
     <Reference Include="UnityEngine.ParticleSystemModule">
-      <HintPath>C:/Apps/Unity/Editor/Data/Managed/UnityEngine/UnityEngine.ParticleSystemModule.dll</HintPath>
+      <HintPath>C:/Apps/Unity2017.4.3/Editor/Data/Managed/UnityEngine/UnityEngine.ParticleSystemModule.dll</HintPath>
     </Reference>
     <Reference Include="UnityEngine.PhysicsModule">
-      <HintPath>C:/Apps/Unity/Editor/Data/Managed/UnityEngine/UnityEngine.PhysicsModule.dll</HintPath>
+      <HintPath>C:/Apps/Unity2017.4.3/Editor/Data/Managed/UnityEngine/UnityEngine.PhysicsModule.dll</HintPath>
     </Reference>
     <Reference Include="UnityEngine.VehiclesModule">
-      <HintPath>C:/Apps/Unity/Editor/Data/Managed/UnityEngine/UnityEngine.VehiclesModule.dll</HintPath>
+      <HintPath>C:/Apps/Unity2017.4.3/Editor/Data/Managed/UnityEngine/UnityEngine.VehiclesModule.dll</HintPath>
     </Reference>
     <Reference Include="UnityEngine.ClothModule">
-      <HintPath>C:/Apps/Unity/Editor/Data/Managed/UnityEngine/UnityEngine.ClothModule.dll</HintPath>
+      <HintPath>C:/Apps/Unity2017.4.3/Editor/Data/Managed/UnityEngine/UnityEngine.ClothModule.dll</HintPath>
     </Reference>
     <Reference Include="UnityEngine.AIModule">
-      <HintPath>C:/Apps/Unity/Editor/Data/Managed/UnityEngine/UnityEngine.AIModule.dll</HintPath>
+      <HintPath>C:/Apps/Unity2017.4.3/Editor/Data/Managed/UnityEngine/UnityEngine.AIModule.dll</HintPath>
     </Reference>
     <Reference Include="UnityEngine.AnimationModule">
-      <HintPath>C:/Apps/Unity/Editor/Data/Managed/UnityEngine/UnityEngine.AnimationModule.dll</HintPath>
+      <HintPath>C:/Apps/Unity2017.4.3/Editor/Data/Managed/UnityEngine/UnityEngine.AnimationModule.dll</HintPath>
     </Reference>
     <Reference Include="UnityEngine.TextRenderingModule">
-      <HintPath>C:/Apps/Unity/Editor/Data/Managed/UnityEngine/UnityEngine.TextRenderingModule.dll</HintPath>
+      <HintPath>C:/Apps/Unity2017.4.3/Editor/Data/Managed/UnityEngine/UnityEngine.TextRenderingModule.dll</HintPath>
     </Reference>
     <Reference Include="UnityEngine.UIModule">
-      <HintPath>C:/Apps/Unity/Editor/Data/Managed/UnityEngine/UnityEngine.UIModule.dll</HintPath>
+      <HintPath>C:/Apps/Unity2017.4.3/Editor/Data/Managed/UnityEngine/UnityEngine.UIModule.dll</HintPath>
     </Reference>
     <Reference Include="UnityEngine.TerrainPhysicsModule">
-      <HintPath>C:/Apps/Unity/Editor/Data/Managed/UnityEngine/UnityEngine.TerrainPhysicsModule.dll</HintPath>
+      <HintPath>C:/Apps/Unity2017.4.3/Editor/Data/Managed/UnityEngine/UnityEngine.TerrainPhysicsModule.dll</HintPath>
     </Reference>
     <Reference Include="UnityEngine.IMGUIModule">
-      <HintPath>C:/Apps/Unity/Editor/Data/Managed/UnityEngine/UnityEngine.IMGUIModule.dll</HintPath>
+      <HintPath>C:/Apps/Unity2017.4.3/Editor/Data/Managed/UnityEngine/UnityEngine.IMGUIModule.dll</HintPath>
     </Reference>
     <Reference Include="UnityEngine.ClusterInputModule">
-      <HintPath>C:/Apps/Unity/Editor/Data/Managed/UnityEngine/UnityEngine.ClusterInputModule.dll</HintPath>
+      <HintPath>C:/Apps/Unity2017.4.3/Editor/Data/Managed/UnityEngine/UnityEngine.ClusterInputModule.dll</HintPath>
     </Reference>
     <Reference Include="UnityEngine.ClusterRendererModule">
-      <HintPath>C:/Apps/Unity/Editor/Data/Managed/UnityEngine/UnityEngine.ClusterRendererModule.dll</HintPath>
+      <HintPath>C:/Apps/Unity2017.4.3/Editor/Data/Managed/UnityEngine/UnityEngine.ClusterRendererModule.dll</HintPath>
     </Reference>
     <Reference Include="UnityEngine.UNETModule">
-      <HintPath>C:/Apps/Unity/Editor/Data/Managed/UnityEngine/UnityEngine.UNETModule.dll</HintPath>
+      <HintPath>C:/Apps/Unity2017.4.3/Editor/Data/Managed/UnityEngine/UnityEngine.UNETModule.dll</HintPath>
     </Reference>
     <Reference Include="UnityEngine.DirectorModule">
-      <HintPath>C:/Apps/Unity/Editor/Data/Managed/UnityEngine/UnityEngine.DirectorModule.dll</HintPath>
+      <HintPath>C:/Apps/Unity2017.4.3/Editor/Data/Managed/UnityEngine/UnityEngine.DirectorModule.dll</HintPath>
     </Reference>
     <Reference Include="UnityEngine.UnityAnalyticsModule">
-      <HintPath>C:/Apps/Unity/Editor/Data/Managed/UnityEngine/UnityEngine.UnityAnalyticsModule.dll</HintPath>
+      <HintPath>C:/Apps/Unity2017.4.3/Editor/Data/Managed/UnityEngine/UnityEngine.UnityAnalyticsModule.dll</HintPath>
     </Reference>
     <Reference Include="UnityEngine.PerformanceReportingModule">
-      <HintPath>C:/Apps/Unity/Editor/Data/Managed/UnityEngine/UnityEngine.PerformanceReportingModule.dll</HintPath>
+      <HintPath>C:/Apps/Unity2017.4.3/Editor/Data/Managed/UnityEngine/UnityEngine.PerformanceReportingModule.dll</HintPath>
     </Reference>
     <Reference Include="UnityEngine.UnityConnectModule">
-      <HintPath>C:/Apps/Unity/Editor/Data/Managed/UnityEngine/UnityEngine.UnityConnectModule.dll</HintPath>
+      <HintPath>C:/Apps/Unity2017.4.3/Editor/Data/Managed/UnityEngine/UnityEngine.UnityConnectModule.dll</HintPath>
     </Reference>
     <Reference Include="UnityEngine.WebModule">
-      <HintPath>C:/Apps/Unity/Editor/Data/Managed/UnityEngine/UnityEngine.WebModule.dll</HintPath>
+      <HintPath>C:/Apps/Unity2017.4.3/Editor/Data/Managed/UnityEngine/UnityEngine.WebModule.dll</HintPath>
     </Reference>
     <Reference Include="UnityEngine.ARModule">
-      <HintPath>C:/Apps/Unity/Editor/Data/Managed/UnityEngine/UnityEngine.ARModule.dll</HintPath>
+      <HintPath>C:/Apps/Unity2017.4.3/Editor/Data/Managed/UnityEngine/UnityEngine.ARModule.dll</HintPath>
     </Reference>
     <Reference Include="UnityEngine.VRModule">
-      <HintPath>C:/Apps/Unity/Editor/Data/Managed/UnityEngine/UnityEngine.VRModule.dll</HintPath>
+      <HintPath>C:/Apps/Unity2017.4.3/Editor/Data/Managed/UnityEngine/UnityEngine.VRModule.dll</HintPath>
     </Reference>
     <Reference Include="UnityEngine.UIElementsModule">
-      <HintPath>C:/Apps/Unity/Editor/Data/Managed/UnityEngine/UnityEngine.UIElementsModule.dll</HintPath>
+      <HintPath>C:/Apps/Unity2017.4.3/Editor/Data/Managed/UnityEngine/UnityEngine.UIElementsModule.dll</HintPath>
     </Reference>
     <Reference Include="UnityEngine.StyleSheetsModule">
-      <HintPath>C:/Apps/Unity/Editor/Data/Managed/UnityEngine/UnityEngine.StyleSheetsModule.dll</HintPath>
+      <HintPath>C:/Apps/Unity2017.4.3/Editor/Data/Managed/UnityEngine/UnityEngine.StyleSheetsModule.dll</HintPath>
     </Reference>
     <Reference Include="UnityEngine.AssetBundleModule">
-      <HintPath>C:/Apps/Unity/Editor/Data/Managed/UnityEngine/UnityEngine.AssetBundleModule.dll</HintPath>
+      <HintPath>C:/Apps/Unity2017.4.3/Editor/Data/Managed/UnityEngine/UnityEngine.AssetBundleModule.dll</HintPath>
     </Reference>
     <Reference Include="UnityEngine.AudioModule">
-      <HintPath>C:/Apps/Unity/Editor/Data/Managed/UnityEngine/UnityEngine.AudioModule.dll</HintPath>
+      <HintPath>C:/Apps/Unity2017.4.3/Editor/Data/Managed/UnityEngine/UnityEngine.AudioModule.dll</HintPath>
     </Reference>
     <Reference Include="UnityEngine.CrashReportingModule">
-      <HintPath>C:/Apps/Unity/Editor/Data/Managed/UnityEngine/UnityEngine.CrashReportingModule.dll</HintPath>
+      <HintPath>C:/Apps/Unity2017.4.3/Editor/Data/Managed/UnityEngine/UnityEngine.CrashReportingModule.dll</HintPath>
     </Reference>
     <Reference Include="UnityEngine.GameCenterModule">
-      <HintPath>C:/Apps/Unity/Editor/Data/Managed/UnityEngine/UnityEngine.GameCenterModule.dll</HintPath>
+      <HintPath>C:/Apps/Unity2017.4.3/Editor/Data/Managed/UnityEngine/UnityEngine.GameCenterModule.dll</HintPath>
     </Reference>
     <Reference Include="UnityEngine.GridModule">
-      <HintPath>C:/Apps/Unity/Editor/Data/Managed/UnityEngine/UnityEngine.GridModule.dll</HintPath>
+      <HintPath>C:/Apps/Unity2017.4.3/Editor/Data/Managed/UnityEngine/UnityEngine.GridModule.dll</HintPath>
     </Reference>
     <Reference Include="UnityEngine.ImageConversionModule">
-      <HintPath>C:/Apps/Unity/Editor/Data/Managed/UnityEngine/UnityEngine.ImageConversionModule.dll</HintPath>
+      <HintPath>C:/Apps/Unity2017.4.3/Editor/Data/Managed/UnityEngine/UnityEngine.ImageConversionModule.dll</HintPath>
     </Reference>
     <Reference Include="UnityEngine.InputModule">
-      <HintPath>C:/Apps/Unity/Editor/Data/Managed/UnityEngine/UnityEngine.InputModule.dll</HintPath>
+      <HintPath>C:/Apps/Unity2017.4.3/Editor/Data/Managed/UnityEngine/UnityEngine.InputModule.dll</HintPath>
     </Reference>
     <Reference Include="UnityEngine.JSONSerializeModule">
-      <HintPath>C:/Apps/Unity/Editor/Data/Managed/UnityEngine/UnityEngine.JSONSerializeModule.dll</HintPath>
+      <HintPath>C:/Apps/Unity2017.4.3/Editor/Data/Managed/UnityEngine/UnityEngine.JSONSerializeModule.dll</HintPath>
     </Reference>
     <Reference Include="UnityEngine.ParticlesLegacyModule">
-      <HintPath>C:/Apps/Unity/Editor/Data/Managed/UnityEngine/UnityEngine.ParticlesLegacyModule.dll</HintPath>
+      <HintPath>C:/Apps/Unity2017.4.3/Editor/Data/Managed/UnityEngine/UnityEngine.ParticlesLegacyModule.dll</HintPath>
     </Reference>
     <Reference Include="UnityEngine.Physics2DModule">
-      <HintPath>C:/Apps/Unity/Editor/Data/Managed/UnityEngine/UnityEngine.Physics2DModule.dll</HintPath>
+      <HintPath>C:/Apps/Unity2017.4.3/Editor/Data/Managed/UnityEngine/UnityEngine.Physics2DModule.dll</HintPath>
     </Reference>
     <Reference Include="UnityEngine.ScreenCaptureModule">
-      <HintPath>C:/Apps/Unity/Editor/Data/Managed/UnityEngine/UnityEngine.ScreenCaptureModule.dll</HintPath>
+      <HintPath>C:/Apps/Unity2017.4.3/Editor/Data/Managed/UnityEngine/UnityEngine.ScreenCaptureModule.dll</HintPath>
     </Reference>
     <Reference Include="UnityEngine.SharedInternalsModule">
-      <HintPath>C:/Apps/Unity/Editor/Data/Managed/UnityEngine/UnityEngine.SharedInternalsModule.dll</HintPath>
+      <HintPath>C:/Apps/Unity2017.4.3/Editor/Data/Managed/UnityEngine/UnityEngine.SharedInternalsModule.dll</HintPath>
     </Reference>
     <Reference Include="UnityEngine.SpriteMaskModule">
-      <HintPath>C:/Apps/Unity/Editor/Data/Managed/UnityEngine/UnityEngine.SpriteMaskModule.dll</HintPath>
+      <HintPath>C:/Apps/Unity2017.4.3/Editor/Data/Managed/UnityEngine/UnityEngine.SpriteMaskModule.dll</HintPath>
     </Reference>
     <Reference Include="UnityEngine.SpriteShapeModule">
-      <HintPath>C:/Apps/Unity/Editor/Data/Managed/UnityEngine/UnityEngine.SpriteShapeModule.dll</HintPath>
+      <HintPath>C:/Apps/Unity2017.4.3/Editor/Data/Managed/UnityEngine/UnityEngine.SpriteShapeModule.dll</HintPath>
     </Reference>
     <Reference Include="UnityEngine.TerrainModule">
-      <HintPath>C:/Apps/Unity/Editor/Data/Managed/UnityEngine/UnityEngine.TerrainModule.dll</HintPath>
+      <HintPath>C:/Apps/Unity2017.4.3/Editor/Data/Managed/UnityEngine/UnityEngine.TerrainModule.dll</HintPath>
     </Reference>
     <Reference Include="UnityEngine.TilemapModule">
-      <HintPath>C:/Apps/Unity/Editor/Data/Managed/UnityEngine/UnityEngine.TilemapModule.dll</HintPath>
+      <HintPath>C:/Apps/Unity2017.4.3/Editor/Data/Managed/UnityEngine/UnityEngine.TilemapModule.dll</HintPath>
     </Reference>
     <Reference Include="UnityEngine.UnityWebRequestModule">
-      <HintPath>C:/Apps/Unity/Editor/Data/Managed/UnityEngine/UnityEngine.UnityWebRequestModule.dll</HintPath>
+      <HintPath>C:/Apps/Unity2017.4.3/Editor/Data/Managed/UnityEngine/UnityEngine.UnityWebRequestModule.dll</HintPath>
     </Reference>
     <Reference Include="UnityEngine.UnityWebRequestAudioModule">
-      <HintPath>C:/Apps/Unity/Editor/Data/Managed/UnityEngine/UnityEngine.UnityWebRequestAudioModule.dll</HintPath>
+      <HintPath>C:/Apps/Unity2017.4.3/Editor/Data/Managed/UnityEngine/UnityEngine.UnityWebRequestAudioModule.dll</HintPath>
     </Reference>
     <Reference Include="UnityEngine.UnityWebRequestTextureModule">
-      <HintPath>C:/Apps/Unity/Editor/Data/Managed/UnityEngine/UnityEngine.UnityWebRequestTextureModule.dll</HintPath>
+      <HintPath>C:/Apps/Unity2017.4.3/Editor/Data/Managed/UnityEngine/UnityEngine.UnityWebRequestTextureModule.dll</HintPath>
     </Reference>
     <Reference Include="UnityEngine.UnityWebRequestWWWModule">
-      <HintPath>C:/Apps/Unity/Editor/Data/Managed/UnityEngine/UnityEngine.UnityWebRequestWWWModule.dll</HintPath>
+      <HintPath>C:/Apps/Unity2017.4.3/Editor/Data/Managed/UnityEngine/UnityEngine.UnityWebRequestWWWModule.dll</HintPath>
     </Reference>
     <Reference Include="UnityEngine.VideoModule">
-      <HintPath>C:/Apps/Unity/Editor/Data/Managed/UnityEngine/UnityEngine.VideoModule.dll</HintPath>
+      <HintPath>C:/Apps/Unity2017.4.3/Editor/Data/Managed/UnityEngine/UnityEngine.VideoModule.dll</HintPath>
     </Reference>
     <Reference Include="UnityEngine.WindModule">
-      <HintPath>C:/Apps/Unity/Editor/Data/Managed/UnityEngine/UnityEngine.WindModule.dll</HintPath>
+      <HintPath>C:/Apps/Unity2017.4.3/Editor/Data/Managed/UnityEngine/UnityEngine.WindModule.dll</HintPath>
     </Reference>
     <Reference Include="UnityEngine.UI">
-      <HintPath>C:/Apps/Unity/Editor/Data/UnityExtensions/Unity/GUISystem/UnityEngine.UI.dll</HintPath>
+      <HintPath>C:/Apps/Unity2017.4.3/Editor/Data/UnityExtensions/Unity/GUISystem/UnityEngine.UI.dll</HintPath>
     </Reference>
     <Reference Include="UnityEditor.UI">
-      <HintPath>C:/Apps/Unity/Editor/Data/UnityExtensions/Unity/GUISystem/Editor/UnityEditor.UI.dll</HintPath>
+      <HintPath>C:/Apps/Unity2017.4.3/Editor/Data/UnityExtensions/Unity/GUISystem/Editor/UnityEditor.UI.dll</HintPath>
     </Reference>
     <Reference Include="UnityEngine.Networking">
-      <HintPath>C:/Apps/Unity/Editor/Data/UnityExtensions/Unity/Networking/UnityEngine.Networking.dll</HintPath>
+      <HintPath>C:/Apps/Unity2017.4.3/Editor/Data/UnityExtensions/Unity/Networking/UnityEngine.Networking.dll</HintPath>
     </Reference>
     <Reference Include="UnityEditor.Networking">
-      <HintPath>C:/Apps/Unity/Editor/Data/UnityExtensions/Unity/Networking/Editor/UnityEditor.Networking.dll</HintPath>
+      <HintPath>C:/Apps/Unity2017.4.3/Editor/Data/UnityExtensions/Unity/Networking/Editor/UnityEditor.Networking.dll</HintPath>
     </Reference>
     <Reference Include="UnityEditor.TestRunner">
-      <HintPath>C:/Apps/Unity/Editor/Data/UnityExtensions/Unity/TestRunner/Editor/UnityEditor.TestRunner.dll</HintPath>
+      <HintPath>C:/Apps/Unity2017.4.3/Editor/Data/UnityExtensions/Unity/TestRunner/Editor/UnityEditor.TestRunner.dll</HintPath>
     </Reference>
     <Reference Include="UnityEngine.TestRunner">
-      <HintPath>C:/Apps/Unity/Editor/Data/UnityExtensions/Unity/TestRunner/UnityEngine.TestRunner.dll</HintPath>
+      <HintPath>C:/Apps/Unity2017.4.3/Editor/Data/UnityExtensions/Unity/TestRunner/UnityEngine.TestRunner.dll</HintPath>
     </Reference>
     <Reference Include="nunit.framework">
-      <HintPath>C:/Apps/Unity/Editor/Data/UnityExtensions/Unity/TestRunner/net35/unity-custom/nunit.framework.dll</HintPath>
+      <HintPath>C:/Apps/Unity2017.4.3/Editor/Data/UnityExtensions/Unity/TestRunner/net35/unity-custom/nunit.framework.dll</HintPath>
     </Reference>
     <Reference Include="UnityEngine.Timeline">
-      <HintPath>C:/Apps/Unity/Editor/Data/UnityExtensions/Unity/Timeline/RuntimeEditor/UnityEngine.Timeline.dll</HintPath>
+      <HintPath>C:/Apps/Unity2017.4.3/Editor/Data/UnityExtensions/Unity/Timeline/RuntimeEditor/UnityEngine.Timeline.dll</HintPath>
     </Reference>
     <Reference Include="UnityEditor.Timeline">
-      <HintPath>C:/Apps/Unity/Editor/Data/UnityExtensions/Unity/Timeline/Editor/UnityEditor.Timeline.dll</HintPath>
+      <HintPath>C:/Apps/Unity2017.4.3/Editor/Data/UnityExtensions/Unity/Timeline/Editor/UnityEditor.Timeline.dll</HintPath>
     </Reference>
     <Reference Include="UnityEditor.TreeEditor">
-      <HintPath>C:/Apps/Unity/Editor/Data/UnityExtensions/Unity/TreeEditor/Editor/UnityEditor.TreeEditor.dll</HintPath>
+      <HintPath>C:/Apps/Unity2017.4.3/Editor/Data/UnityExtensions/Unity/TreeEditor/Editor/UnityEditor.TreeEditor.dll</HintPath>
     </Reference>
     <Reference Include="UnityEngine.UIAutomation">
-      <HintPath>C:/Apps/Unity/Editor/Data/UnityExtensions/Unity/UIAutomation/UnityEngine.UIAutomation.dll</HintPath>
+      <HintPath>C:/Apps/Unity2017.4.3/Editor/Data/UnityExtensions/Unity/UIAutomation/UnityEngine.UIAutomation.dll</HintPath>
     </Reference>
     <Reference Include="UnityEditor.UIAutomation">
-      <HintPath>C:/Apps/Unity/Editor/Data/UnityExtensions/Unity/UIAutomation/Editor/UnityEditor.UIAutomation.dll</HintPath>
+      <HintPath>C:/Apps/Unity2017.4.3/Editor/Data/UnityExtensions/Unity/UIAutomation/Editor/UnityEditor.UIAutomation.dll</HintPath>
     </Reference>
     <Reference Include="UnityEditor.GoogleAudioSpatializer">
-      <HintPath>C:/Apps/Unity/Editor/Data/UnityExtensions/Unity/UnityGoogleAudioSpatializer/Editor/UnityEditor.GoogleAudioSpatializer.dll</HintPath>
+      <HintPath>C:/Apps/Unity2017.4.3/Editor/Data/UnityExtensions/Unity/UnityGoogleAudioSpatializer/Editor/UnityEditor.GoogleAudioSpatializer.dll</HintPath>
     </Reference>
     <Reference Include="UnityEngine.GoogleAudioSpatializer">
-      <HintPath>C:/Apps/Unity/Editor/Data/UnityExtensions/Unity/UnityGoogleAudioSpatializer/RuntimeEditor/UnityEngine.GoogleAudioSpatializer.dll</HintPath>
+      <HintPath>C:/Apps/Unity2017.4.3/Editor/Data/UnityExtensions/Unity/UnityGoogleAudioSpatializer/RuntimeEditor/UnityEngine.GoogleAudioSpatializer.dll</HintPath>
     </Reference>
     <Reference Include="UnityEditor.HoloLens">
-      <HintPath>C:/Apps/Unity/Editor/Data/UnityExtensions/Unity/UnityHoloLens/Editor/UnityEditor.HoloLens.dll</HintPath>
+      <HintPath>C:/Apps/Unity2017.4.3/Editor/Data/UnityExtensions/Unity/UnityHoloLens/Editor/UnityEditor.HoloLens.dll</HintPath>
     </Reference>
     <Reference Include="UnityEngine.HoloLens">
-      <HintPath>C:/Apps/Unity/Editor/Data/UnityExtensions/Unity/UnityHoloLens/RuntimeEditor/UnityEngine.HoloLens.dll</HintPath>
+      <HintPath>C:/Apps/Unity2017.4.3/Editor/Data/UnityExtensions/Unity/UnityHoloLens/RuntimeEditor/UnityEngine.HoloLens.dll</HintPath>
     </Reference>
     <Reference Include="UnityEditor.SpatialTracking">
-      <HintPath>C:/Apps/Unity/Editor/Data/UnityExtensions/Unity/UnitySpatialTracking/Editor/UnityEditor.SpatialTracking.dll</HintPath>
+      <HintPath>C:/Apps/Unity2017.4.3/Editor/Data/UnityExtensions/Unity/UnitySpatialTracking/Editor/UnityEditor.SpatialTracking.dll</HintPath>
     </Reference>
     <Reference Include="UnityEngine.SpatialTracking">
-      <HintPath>C:/Apps/Unity/Editor/Data/UnityExtensions/Unity/UnitySpatialTracking/RuntimeEditor/UnityEngine.SpatialTracking.dll</HintPath>
+      <HintPath>C:/Apps/Unity2017.4.3/Editor/Data/UnityExtensions/Unity/UnitySpatialTracking/RuntimeEditor/UnityEngine.SpatialTracking.dll</HintPath>
     </Reference>
     <Reference Include="UnityEditor.VR">
-      <HintPath>C:/Apps/Unity/Editor/Data/UnityExtensions/Unity/UnityVR/Editor/UnityEditor.VR.dll</HintPath>
+      <HintPath>C:/Apps/Unity2017.4.3/Editor/Data/UnityExtensions/Unity/UnityVR/Editor/UnityEditor.VR.dll</HintPath>
     </Reference>
     <Reference Include="UnityEditor.Graphs">
-      <HintPath>C:/Apps/Unity/Editor/Data/Managed/UnityEditor.Graphs.dll</HintPath>
+      <HintPath>C:/Apps/Unity2017.4.3/Editor/Data/Managed/UnityEditor.Graphs.dll</HintPath>
     </Reference>
     <Reference Include="UnityEditor.Android.Extensions">
-      <HintPath>C:/Apps/Unity/Editor/Data/PlaybackEngines/AndroidPlayer/UnityEditor.Android.Extensions.dll</HintPath>
+      <HintPath>C:/Apps/Unity2017.4.3/Editor/Data/PlaybackEngines/AndroidPlayer/UnityEditor.Android.Extensions.dll</HintPath>
     </Reference>
     <Reference Include="UnityEditor.WindowsStandalone.Extensions">
-      <HintPath>C:/Apps/Unity/Editor/Data/PlaybackEngines/windowsstandalonesupport/UnityEditor.WindowsStandalone.Extensions.dll</HintPath>
+      <HintPath>C:/Apps/Unity2017.4.3/Editor/Data/PlaybackEngines/windowsstandalonesupport/UnityEditor.WindowsStandalone.Extensions.dll</HintPath>
     </Reference>
     <Reference Include="SyntaxTree.VisualStudio.Unity.Bridge">
       <HintPath>C:/Program Files (x86)/Microsoft Visual Studio Tools for Unity/15.0/Editor/SyntaxTree.VisualStudio.Unity.Bridge.dll</HintPath>
@@ -300,22 +300,22 @@
       <HintPath>Assets/Plugins/Editor/npoi/NPOI.OpenXmlFormats.dll</HintPath>
     </Reference>
     <Reference Include="UnityEditor.Advertisements">
-      <HintPath>C:/Users/tanghai/AppData/Local/Unity/cache/packages/packages.unity.com/com.unity.ads@2.0.8/Editor/UnityEditor.Advertisements.dll</HintPath>
+      <HintPath>C:/Users/USER-PC/AppData/Local/Unity/cache/packages/packages.unity.com/com.unity.ads@2.0.8/Editor/UnityEditor.Advertisements.dll</HintPath>
     </Reference>
     <Reference Include="UnityEngine.Analytics">
-      <HintPath>C:/Users/tanghai/AppData/Local/Unity/cache/packages/packages.unity.com/com.unity.analytics@2.0.13/UnityEngine.Analytics.dll</HintPath>
+      <HintPath>C:/Users/USER-PC/AppData/Local/Unity/cache/packages/packages.unity.com/com.unity.analytics@2.0.13/UnityEngine.Analytics.dll</HintPath>
     </Reference>
     <Reference Include="UnityEditor.Analytics">
-      <HintPath>C:/Users/tanghai/AppData/Local/Unity/cache/packages/packages.unity.com/com.unity.analytics@2.0.13/Editor/UnityEditor.Analytics.dll</HintPath>
+      <HintPath>C:/Users/USER-PC/AppData/Local/Unity/cache/packages/packages.unity.com/com.unity.analytics@2.0.13/Editor/UnityEditor.Analytics.dll</HintPath>
     </Reference>
     <Reference Include="UnityEngine.Purchasing">
-      <HintPath>C:/Users/tanghai/AppData/Local/Unity/cache/packages/packages.unity.com/com.unity.purchasing@0.0.19/UnityEngine.Purchasing.dll</HintPath>
+      <HintPath>C:/Users/USER-PC/AppData/Local/Unity/cache/packages/packages.unity.com/com.unity.purchasing@0.0.19/UnityEngine.Purchasing.dll</HintPath>
     </Reference>
     <Reference Include="UnityEditor.Purchasing">
-      <HintPath>C:/Users/tanghai/AppData/Local/Unity/cache/packages/packages.unity.com/com.unity.purchasing@0.0.19/Editor/UnityEditor.Purchasing.dll</HintPath>
+      <HintPath>C:/Users/USER-PC/AppData/Local/Unity/cache/packages/packages.unity.com/com.unity.purchasing@0.0.19/Editor/UnityEditor.Purchasing.dll</HintPath>
     </Reference>
     <Reference Include="UnityEngine.StandardEvents">
-      <HintPath>C:/Users/tanghai/AppData/Local/Unity/cache/packages/packages.unity.com/com.unity.standardevents@1.0.10/UnityEngine.StandardEvents.dll</HintPath>
+      <HintPath>C:/Users/USER-PC/AppData/Local/Unity/cache/packages/packages.unity.com/com.unity.standardevents@1.0.10/UnityEngine.StandardEvents.dll</HintPath>
     </Reference>
   </ItemGroup>
   <ItemGroup>

+ 70 - 70
Unity/Unity.Plugins.csproj

@@ -16,7 +16,7 @@
     <CompilerResponseFile></CompilerResponseFile>
     <UnityProjectGenerator>VSTU</UnityProjectGenerator>
     <UnityProjectType>GamePlugins:3</UnityProjectType>
-    <UnityBuildTarget>StandaloneWindows64:19</UnityBuildTarget>
+    <UnityBuildTarget>StandaloneWindows:5</UnityBuildTarget>
     <UnityVersion>2017.4.3f1</UnityVersion>
     <RootNamespace></RootNamespace>
     <LangVersion>6</LangVersion>
@@ -33,7 +33,7 @@
     <IntermediateOutputPath>Temp\UnityVS_obj\Debug\</IntermediateOutputPath>
     <ErrorReport>prompt</ErrorReport>
     <WarningLevel>4</WarningLevel>
-    <DefineConstants>DEBUG;TRACE;UNITY_5_3_OR_NEWER;UNITY_5_4_OR_NEWER;UNITY_5_5_OR_NEWER;UNITY_5_6_OR_NEWER;UNITY_2017_1_OR_NEWER;UNITY_2017_2_OR_NEWER;UNITY_2017_3_OR_NEWER;UNITY_2017_4_OR_NEWER;UNITY_2017_4_3;UNITY_2017_4;UNITY_2017;PLATFORM_ARCH_64;UNITY_64;ENABLE_AUDIO;ENABLE_CACHING;ENABLE_CLOTH;ENABLE_DUCK_TYPING;ENABLE_GENERICS;ENABLE_PVR_GI;ENABLE_MICROPHONE;ENABLE_MULTIPLE_DISPLAYS;ENABLE_PHYSICS;ENABLE_SPRITERENDERER_FLIPPING;ENABLE_SPRITES;ENABLE_GRID;ENABLE_TILEMAP;ENABLE_TERRAIN;ENABLE_RAKNET;ENABLE_DIRECTOR;ENABLE_UNET;ENABLE_LZMA;ENABLE_UNITYEVENTS;ENABLE_WEBCAM;ENABLE_WWW;ENABLE_CLOUD_SERVICES_COLLAB;ENABLE_CLOUD_SERVICES_COLLAB_SOFTLOCKS;ENABLE_CLOUD_SERVICES_ADS;ENABLE_CLOUD_HUB;ENABLE_CLOUD_PROJECT_ID;ENABLE_CLOUD_SERVICES_USE_WEBREQUEST;ENABLE_CLOUD_SERVICES_UNET;ENABLE_CLOUD_SERVICES_BUILD;ENABLE_CLOUD_LICENSE;ENABLE_EDITOR_HUB;ENABLE_EDITOR_HUB_LICENSE;ENABLE_WEBSOCKET_CLIENT;ENABLE_DIRECTOR_AUDIO;ENABLE_DIRECTOR_TEXTURE;ENABLE_TIMELINE;ENABLE_EDITOR_METRICS;ENABLE_EDITOR_METRICS_CACHING;ENABLE_NATIVE_ARRAY;ENABLE_SPRITE_MASKING;INCLUDE_DYNAMIC_GI;INCLUDE_GI;ENABLE_MONO_BDWGC;PLATFORM_SUPPORTS_MONO;RENDER_SOFTWARE_CURSOR;INCLUDE_PUBNUB;ENABLE_PLAYMODE_TESTS_RUNNER;ENABLE_VIDEO;ENABLE_RMGUI;ENABLE_PACKMAN;ENABLE_CUSTOM_RENDER_TEXTURE;ENABLE_STYLE_SHEETS;ENABLE_LOCALIZATION;PLATFORM_STANDALONE_WIN;PLATFORM_STANDALONE;UNITY_STANDALONE_WIN;UNITY_STANDALONE;ENABLE_SUBSTANCE;ENABLE_RUNTIME_GI;ENABLE_MOVIES;ENABLE_NETWORK;ENABLE_CRUNCH_TEXTURE_COMPRESSION;ENABLE_UNITYWEBREQUEST;ENABLE_CLOUD_SERVICES;ENABLE_CLOUD_SERVICES_ANALYTICS;ENABLE_CLOUD_SERVICES_PURCHASING;ENABLE_CLOUD_SERVICES_CRASH_REPORTING;ENABLE_EVENT_QUEUE;ENABLE_CLUSTERINPUT;ENABLE_VR;ENABLE_AR;ENABLE_WEBSOCKET_HOST;ENABLE_MONO;NET_4_6;ENABLE_PROFILER;DEBUG;TRACE;UNITY_ASSERTIONS;UNITY_EDITOR;UNITY_EDITOR_64;UNITY_EDITOR_WIN;ENABLE_NATIVE_ARRAY_CHECKS;UNITY_TEAM_LICENSE;ENABLE_VSTU;UNITY_PRO_LICENSE;NET45;ILRuntime</DefineConstants>
+    <DefineConstants>DEBUG;TRACE;UNITY_5_3_OR_NEWER;UNITY_5_4_OR_NEWER;UNITY_5_5_OR_NEWER;UNITY_5_6_OR_NEWER;UNITY_2017_1_OR_NEWER;UNITY_2017_2_OR_NEWER;UNITY_2017_3_OR_NEWER;UNITY_2017_4_OR_NEWER;UNITY_2017_4_3;UNITY_2017_4;UNITY_2017;ENABLE_AUDIO;ENABLE_CACHING;ENABLE_CLOTH;ENABLE_DUCK_TYPING;ENABLE_GENERICS;ENABLE_PVR_GI;ENABLE_MICROPHONE;ENABLE_MULTIPLE_DISPLAYS;ENABLE_PHYSICS;ENABLE_SPRITERENDERER_FLIPPING;ENABLE_SPRITES;ENABLE_GRID;ENABLE_TILEMAP;ENABLE_TERRAIN;ENABLE_RAKNET;ENABLE_DIRECTOR;ENABLE_UNET;ENABLE_LZMA;ENABLE_UNITYEVENTS;ENABLE_WEBCAM;ENABLE_WWW;ENABLE_CLOUD_SERVICES_COLLAB;ENABLE_CLOUD_SERVICES_COLLAB_SOFTLOCKS;ENABLE_CLOUD_SERVICES_ADS;ENABLE_CLOUD_HUB;ENABLE_CLOUD_PROJECT_ID;ENABLE_CLOUD_SERVICES_USE_WEBREQUEST;ENABLE_CLOUD_SERVICES_UNET;ENABLE_CLOUD_SERVICES_BUILD;ENABLE_CLOUD_LICENSE;ENABLE_EDITOR_HUB;ENABLE_EDITOR_HUB_LICENSE;ENABLE_WEBSOCKET_CLIENT;ENABLE_DIRECTOR_AUDIO;ENABLE_DIRECTOR_TEXTURE;ENABLE_TIMELINE;ENABLE_EDITOR_METRICS;ENABLE_EDITOR_METRICS_CACHING;ENABLE_NATIVE_ARRAY;ENABLE_SPRITE_MASKING;INCLUDE_DYNAMIC_GI;INCLUDE_GI;ENABLE_MONO_BDWGC;PLATFORM_SUPPORTS_MONO;RENDER_SOFTWARE_CURSOR;INCLUDE_PUBNUB;ENABLE_PLAYMODE_TESTS_RUNNER;ENABLE_VIDEO;ENABLE_RMGUI;ENABLE_PACKMAN;ENABLE_CUSTOM_RENDER_TEXTURE;ENABLE_STYLE_SHEETS;ENABLE_LOCALIZATION;PLATFORM_STANDALONE_WIN;PLATFORM_STANDALONE;UNITY_STANDALONE_WIN;UNITY_STANDALONE;ENABLE_SUBSTANCE;ENABLE_RUNTIME_GI;ENABLE_MOVIES;ENABLE_NETWORK;ENABLE_CRUNCH_TEXTURE_COMPRESSION;ENABLE_UNITYWEBREQUEST;ENABLE_CLOUD_SERVICES;ENABLE_CLOUD_SERVICES_ANALYTICS;ENABLE_CLOUD_SERVICES_PURCHASING;ENABLE_CLOUD_SERVICES_CRASH_REPORTING;ENABLE_EVENT_QUEUE;ENABLE_CLUSTERINPUT;ENABLE_VR;ENABLE_AR;ENABLE_WEBSOCKET_HOST;ENABLE_MONO;NET_4_6;ENABLE_PROFILER;DEBUG;TRACE;UNITY_ASSERTIONS;UNITY_EDITOR;UNITY_EDITOR_64;UNITY_EDITOR_WIN;ENABLE_NATIVE_ARRAY_CHECKS;UNITY_TEAM_LICENSE;ENABLE_VSTU;UNITY_PRO_LICENSE;NET45;ILRuntime1</DefineConstants>
     <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
   </PropertyGroup>
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
@@ -43,201 +43,201 @@
     <IntermediateOutputPath>Temp\UnityVS_obj\Release\</IntermediateOutputPath>
     <ErrorReport>prompt</ErrorReport>
     <WarningLevel>4</WarningLevel>
-    <DefineConstants>TRACE;UNITY_5_3_OR_NEWER;UNITY_5_4_OR_NEWER;UNITY_5_5_OR_NEWER;UNITY_5_6_OR_NEWER;UNITY_2017_1_OR_NEWER;UNITY_2017_2_OR_NEWER;UNITY_2017_3_OR_NEWER;UNITY_2017_4_OR_NEWER;UNITY_2017_4_3;UNITY_2017_4;UNITY_2017;PLATFORM_ARCH_64;UNITY_64;ENABLE_AUDIO;ENABLE_CACHING;ENABLE_CLOTH;ENABLE_DUCK_TYPING;ENABLE_GENERICS;ENABLE_PVR_GI;ENABLE_MICROPHONE;ENABLE_MULTIPLE_DISPLAYS;ENABLE_PHYSICS;ENABLE_SPRITERENDERER_FLIPPING;ENABLE_SPRITES;ENABLE_GRID;ENABLE_TILEMAP;ENABLE_TERRAIN;ENABLE_RAKNET;ENABLE_DIRECTOR;ENABLE_UNET;ENABLE_LZMA;ENABLE_UNITYEVENTS;ENABLE_WEBCAM;ENABLE_WWW;ENABLE_CLOUD_SERVICES_COLLAB;ENABLE_CLOUD_SERVICES_COLLAB_SOFTLOCKS;ENABLE_CLOUD_SERVICES_ADS;ENABLE_CLOUD_HUB;ENABLE_CLOUD_PROJECT_ID;ENABLE_CLOUD_SERVICES_USE_WEBREQUEST;ENABLE_CLOUD_SERVICES_UNET;ENABLE_CLOUD_SERVICES_BUILD;ENABLE_CLOUD_LICENSE;ENABLE_EDITOR_HUB;ENABLE_EDITOR_HUB_LICENSE;ENABLE_WEBSOCKET_CLIENT;ENABLE_DIRECTOR_AUDIO;ENABLE_DIRECTOR_TEXTURE;ENABLE_TIMELINE;ENABLE_EDITOR_METRICS;ENABLE_EDITOR_METRICS_CACHING;ENABLE_NATIVE_ARRAY;ENABLE_SPRITE_MASKING;INCLUDE_DYNAMIC_GI;INCLUDE_GI;ENABLE_MONO_BDWGC;PLATFORM_SUPPORTS_MONO;RENDER_SOFTWARE_CURSOR;INCLUDE_PUBNUB;ENABLE_PLAYMODE_TESTS_RUNNER;ENABLE_VIDEO;ENABLE_RMGUI;ENABLE_PACKMAN;ENABLE_CUSTOM_RENDER_TEXTURE;ENABLE_STYLE_SHEETS;ENABLE_LOCALIZATION;PLATFORM_STANDALONE_WIN;PLATFORM_STANDALONE;UNITY_STANDALONE_WIN;UNITY_STANDALONE;ENABLE_SUBSTANCE;ENABLE_RUNTIME_GI;ENABLE_MOVIES;ENABLE_NETWORK;ENABLE_CRUNCH_TEXTURE_COMPRESSION;ENABLE_UNITYWEBREQUEST;ENABLE_CLOUD_SERVICES;ENABLE_CLOUD_SERVICES_ANALYTICS;ENABLE_CLOUD_SERVICES_PURCHASING;ENABLE_CLOUD_SERVICES_CRASH_REPORTING;ENABLE_EVENT_QUEUE;ENABLE_CLUSTERINPUT;ENABLE_VR;ENABLE_AR;ENABLE_WEBSOCKET_HOST;ENABLE_MONO;NET_4_6;ENABLE_PROFILER;DEBUG;TRACE;UNITY_ASSERTIONS;UNITY_EDITOR;UNITY_EDITOR_64;UNITY_EDITOR_WIN;ENABLE_NATIVE_ARRAY_CHECKS;UNITY_TEAM_LICENSE;ENABLE_VSTU;UNITY_PRO_LICENSE;NET45;ILRuntime</DefineConstants>
+    <DefineConstants>TRACE;UNITY_5_3_OR_NEWER;UNITY_5_4_OR_NEWER;UNITY_5_5_OR_NEWER;UNITY_5_6_OR_NEWER;UNITY_2017_1_OR_NEWER;UNITY_2017_2_OR_NEWER;UNITY_2017_3_OR_NEWER;UNITY_2017_4_OR_NEWER;UNITY_2017_4_3;UNITY_2017_4;UNITY_2017;ENABLE_AUDIO;ENABLE_CACHING;ENABLE_CLOTH;ENABLE_DUCK_TYPING;ENABLE_GENERICS;ENABLE_PVR_GI;ENABLE_MICROPHONE;ENABLE_MULTIPLE_DISPLAYS;ENABLE_PHYSICS;ENABLE_SPRITERENDERER_FLIPPING;ENABLE_SPRITES;ENABLE_GRID;ENABLE_TILEMAP;ENABLE_TERRAIN;ENABLE_RAKNET;ENABLE_DIRECTOR;ENABLE_UNET;ENABLE_LZMA;ENABLE_UNITYEVENTS;ENABLE_WEBCAM;ENABLE_WWW;ENABLE_CLOUD_SERVICES_COLLAB;ENABLE_CLOUD_SERVICES_COLLAB_SOFTLOCKS;ENABLE_CLOUD_SERVICES_ADS;ENABLE_CLOUD_HUB;ENABLE_CLOUD_PROJECT_ID;ENABLE_CLOUD_SERVICES_USE_WEBREQUEST;ENABLE_CLOUD_SERVICES_UNET;ENABLE_CLOUD_SERVICES_BUILD;ENABLE_CLOUD_LICENSE;ENABLE_EDITOR_HUB;ENABLE_EDITOR_HUB_LICENSE;ENABLE_WEBSOCKET_CLIENT;ENABLE_DIRECTOR_AUDIO;ENABLE_DIRECTOR_TEXTURE;ENABLE_TIMELINE;ENABLE_EDITOR_METRICS;ENABLE_EDITOR_METRICS_CACHING;ENABLE_NATIVE_ARRAY;ENABLE_SPRITE_MASKING;INCLUDE_DYNAMIC_GI;INCLUDE_GI;ENABLE_MONO_BDWGC;PLATFORM_SUPPORTS_MONO;RENDER_SOFTWARE_CURSOR;INCLUDE_PUBNUB;ENABLE_PLAYMODE_TESTS_RUNNER;ENABLE_VIDEO;ENABLE_RMGUI;ENABLE_PACKMAN;ENABLE_CUSTOM_RENDER_TEXTURE;ENABLE_STYLE_SHEETS;ENABLE_LOCALIZATION;PLATFORM_STANDALONE_WIN;PLATFORM_STANDALONE;UNITY_STANDALONE_WIN;UNITY_STANDALONE;ENABLE_SUBSTANCE;ENABLE_RUNTIME_GI;ENABLE_MOVIES;ENABLE_NETWORK;ENABLE_CRUNCH_TEXTURE_COMPRESSION;ENABLE_UNITYWEBREQUEST;ENABLE_CLOUD_SERVICES;ENABLE_CLOUD_SERVICES_ANALYTICS;ENABLE_CLOUD_SERVICES_PURCHASING;ENABLE_CLOUD_SERVICES_CRASH_REPORTING;ENABLE_EVENT_QUEUE;ENABLE_CLUSTERINPUT;ENABLE_VR;ENABLE_AR;ENABLE_WEBSOCKET_HOST;ENABLE_MONO;NET_4_6;ENABLE_PROFILER;DEBUG;TRACE;UNITY_ASSERTIONS;UNITY_EDITOR;UNITY_EDITOR_64;UNITY_EDITOR_WIN;ENABLE_NATIVE_ARRAY_CHECKS;UNITY_TEAM_LICENSE;ENABLE_VSTU;UNITY_PRO_LICENSE;NET45;ILRuntime1</DefineConstants>
     <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
   </PropertyGroup>
   <ItemGroup>
     <Reference Include="mscorlib">
-      <HintPath>C:\Apps\Unity\Editor\Data\MonoBleedingEdge\lib\mono\4.6-api\mscorlib.dll</HintPath>
+      <HintPath>C:\Apps\Unity2017.4.3\Editor\Data\MonoBleedingEdge\lib\mono\4.6-api\mscorlib.dll</HintPath>
     </Reference>
     <Reference Include="System">
-      <HintPath>C:\Apps\Unity\Editor\Data\MonoBleedingEdge\lib\mono\4.6-api\System.dll</HintPath>
+      <HintPath>C:\Apps\Unity2017.4.3\Editor\Data\MonoBleedingEdge\lib\mono\4.6-api\System.dll</HintPath>
     </Reference>
     <Reference Include="System.XML">
-      <HintPath>C:\Apps\Unity\Editor\Data\MonoBleedingEdge\lib\mono\4.6-api\System.XML.dll</HintPath>
+      <HintPath>C:\Apps\Unity2017.4.3\Editor\Data\MonoBleedingEdge\lib\mono\4.6-api\System.XML.dll</HintPath>
     </Reference>
     <Reference Include="System.Core">
-      <HintPath>C:\Apps\Unity\Editor\Data\MonoBleedingEdge\lib\mono\4.6-api\System.Core.dll</HintPath>
+      <HintPath>C:\Apps\Unity2017.4.3\Editor\Data\MonoBleedingEdge\lib\mono\4.6-api\System.Core.dll</HintPath>
     </Reference>
     <Reference Include="Microsoft.CSharp">
-      <HintPath>C:\Apps\Unity\Editor\Data\MonoBleedingEdge\lib\mono\4.6-api\Microsoft.CSharp.dll</HintPath>
+      <HintPath>C:\Apps\Unity2017.4.3\Editor\Data\MonoBleedingEdge\lib\mono\4.6-api\Microsoft.CSharp.dll</HintPath>
     </Reference>
     <Reference Include="System.Runtime.Serialization">
-      <HintPath>C:\Apps\Unity\Editor\Data\MonoBleedingEdge\lib\mono\4.6-api\System.Runtime.Serialization.dll</HintPath>
+      <HintPath>C:\Apps\Unity2017.4.3\Editor\Data\MonoBleedingEdge\lib\mono\4.6-api\System.Runtime.Serialization.dll</HintPath>
     </Reference>
     <Reference Include="System.Xml.Linq">
-      <HintPath>C:\Apps\Unity\Editor\Data\MonoBleedingEdge\lib\mono\4.6-api\System.Xml.Linq.dll</HintPath>
+      <HintPath>C:\Apps\Unity2017.4.3\Editor\Data\MonoBleedingEdge\lib\mono\4.6-api\System.Xml.Linq.dll</HintPath>
     </Reference>
     <Reference Include="UnityEditor">
-      <HintPath>C:/Apps/Unity/Editor/Data/Managed/UnityEditor.dll</HintPath>
+      <HintPath>C:/Apps/Unity2017.4.3/Editor/Data/Managed/UnityEditor.dll</HintPath>
     </Reference>
     <Reference Include="UnityEngine">
-      <HintPath>C:/Apps/Unity/Editor/Data/Managed/UnityEngine/UnityEngine.dll</HintPath>
+      <HintPath>C:/Apps/Unity2017.4.3/Editor/Data/Managed/UnityEngine/UnityEngine.dll</HintPath>
     </Reference>
     <Reference Include="UnityEngine.CoreModule">
-      <HintPath>C:/Apps/Unity/Editor/Data/Managed/UnityEngine/UnityEngine.CoreModule.dll</HintPath>
+      <HintPath>C:/Apps/Unity2017.4.3/Editor/Data/Managed/UnityEngine/UnityEngine.CoreModule.dll</HintPath>
     </Reference>
     <Reference Include="UnityEngine.AccessibilityModule">
-      <HintPath>C:/Apps/Unity/Editor/Data/Managed/UnityEngine/UnityEngine.AccessibilityModule.dll</HintPath>
+      <HintPath>C:/Apps/Unity2017.4.3/Editor/Data/Managed/UnityEngine/UnityEngine.AccessibilityModule.dll</HintPath>
     </Reference>
     <Reference Include="UnityEngine.ParticleSystemModule">
-      <HintPath>C:/Apps/Unity/Editor/Data/Managed/UnityEngine/UnityEngine.ParticleSystemModule.dll</HintPath>
+      <HintPath>C:/Apps/Unity2017.4.3/Editor/Data/Managed/UnityEngine/UnityEngine.ParticleSystemModule.dll</HintPath>
     </Reference>
     <Reference Include="UnityEngine.PhysicsModule">
-      <HintPath>C:/Apps/Unity/Editor/Data/Managed/UnityEngine/UnityEngine.PhysicsModule.dll</HintPath>
+      <HintPath>C:/Apps/Unity2017.4.3/Editor/Data/Managed/UnityEngine/UnityEngine.PhysicsModule.dll</HintPath>
     </Reference>
     <Reference Include="UnityEngine.VehiclesModule">
-      <HintPath>C:/Apps/Unity/Editor/Data/Managed/UnityEngine/UnityEngine.VehiclesModule.dll</HintPath>
+      <HintPath>C:/Apps/Unity2017.4.3/Editor/Data/Managed/UnityEngine/UnityEngine.VehiclesModule.dll</HintPath>
     </Reference>
     <Reference Include="UnityEngine.ClothModule">
-      <HintPath>C:/Apps/Unity/Editor/Data/Managed/UnityEngine/UnityEngine.ClothModule.dll</HintPath>
+      <HintPath>C:/Apps/Unity2017.4.3/Editor/Data/Managed/UnityEngine/UnityEngine.ClothModule.dll</HintPath>
     </Reference>
     <Reference Include="UnityEngine.AIModule">
-      <HintPath>C:/Apps/Unity/Editor/Data/Managed/UnityEngine/UnityEngine.AIModule.dll</HintPath>
+      <HintPath>C:/Apps/Unity2017.4.3/Editor/Data/Managed/UnityEngine/UnityEngine.AIModule.dll</HintPath>
     </Reference>
     <Reference Include="UnityEngine.AnimationModule">
-      <HintPath>C:/Apps/Unity/Editor/Data/Managed/UnityEngine/UnityEngine.AnimationModule.dll</HintPath>
+      <HintPath>C:/Apps/Unity2017.4.3/Editor/Data/Managed/UnityEngine/UnityEngine.AnimationModule.dll</HintPath>
     </Reference>
     <Reference Include="UnityEngine.TextRenderingModule">
-      <HintPath>C:/Apps/Unity/Editor/Data/Managed/UnityEngine/UnityEngine.TextRenderingModule.dll</HintPath>
+      <HintPath>C:/Apps/Unity2017.4.3/Editor/Data/Managed/UnityEngine/UnityEngine.TextRenderingModule.dll</HintPath>
     </Reference>
     <Reference Include="UnityEngine.UIModule">
-      <HintPath>C:/Apps/Unity/Editor/Data/Managed/UnityEngine/UnityEngine.UIModule.dll</HintPath>
+      <HintPath>C:/Apps/Unity2017.4.3/Editor/Data/Managed/UnityEngine/UnityEngine.UIModule.dll</HintPath>
     </Reference>
     <Reference Include="UnityEngine.TerrainPhysicsModule">
-      <HintPath>C:/Apps/Unity/Editor/Data/Managed/UnityEngine/UnityEngine.TerrainPhysicsModule.dll</HintPath>
+      <HintPath>C:/Apps/Unity2017.4.3/Editor/Data/Managed/UnityEngine/UnityEngine.TerrainPhysicsModule.dll</HintPath>
     </Reference>
     <Reference Include="UnityEngine.IMGUIModule">
-      <HintPath>C:/Apps/Unity/Editor/Data/Managed/UnityEngine/UnityEngine.IMGUIModule.dll</HintPath>
+      <HintPath>C:/Apps/Unity2017.4.3/Editor/Data/Managed/UnityEngine/UnityEngine.IMGUIModule.dll</HintPath>
     </Reference>
     <Reference Include="UnityEngine.ClusterInputModule">
-      <HintPath>C:/Apps/Unity/Editor/Data/Managed/UnityEngine/UnityEngine.ClusterInputModule.dll</HintPath>
+      <HintPath>C:/Apps/Unity2017.4.3/Editor/Data/Managed/UnityEngine/UnityEngine.ClusterInputModule.dll</HintPath>
     </Reference>
     <Reference Include="UnityEngine.ClusterRendererModule">
-      <HintPath>C:/Apps/Unity/Editor/Data/Managed/UnityEngine/UnityEngine.ClusterRendererModule.dll</HintPath>
+      <HintPath>C:/Apps/Unity2017.4.3/Editor/Data/Managed/UnityEngine/UnityEngine.ClusterRendererModule.dll</HintPath>
     </Reference>
     <Reference Include="UnityEngine.UNETModule">
-      <HintPath>C:/Apps/Unity/Editor/Data/Managed/UnityEngine/UnityEngine.UNETModule.dll</HintPath>
+      <HintPath>C:/Apps/Unity2017.4.3/Editor/Data/Managed/UnityEngine/UnityEngine.UNETModule.dll</HintPath>
     </Reference>
     <Reference Include="UnityEngine.DirectorModule">
-      <HintPath>C:/Apps/Unity/Editor/Data/Managed/UnityEngine/UnityEngine.DirectorModule.dll</HintPath>
+      <HintPath>C:/Apps/Unity2017.4.3/Editor/Data/Managed/UnityEngine/UnityEngine.DirectorModule.dll</HintPath>
     </Reference>
     <Reference Include="UnityEngine.UnityAnalyticsModule">
-      <HintPath>C:/Apps/Unity/Editor/Data/Managed/UnityEngine/UnityEngine.UnityAnalyticsModule.dll</HintPath>
+      <HintPath>C:/Apps/Unity2017.4.3/Editor/Data/Managed/UnityEngine/UnityEngine.UnityAnalyticsModule.dll</HintPath>
     </Reference>
     <Reference Include="UnityEngine.PerformanceReportingModule">
-      <HintPath>C:/Apps/Unity/Editor/Data/Managed/UnityEngine/UnityEngine.PerformanceReportingModule.dll</HintPath>
+      <HintPath>C:/Apps/Unity2017.4.3/Editor/Data/Managed/UnityEngine/UnityEngine.PerformanceReportingModule.dll</HintPath>
     </Reference>
     <Reference Include="UnityEngine.UnityConnectModule">
-      <HintPath>C:/Apps/Unity/Editor/Data/Managed/UnityEngine/UnityEngine.UnityConnectModule.dll</HintPath>
+      <HintPath>C:/Apps/Unity2017.4.3/Editor/Data/Managed/UnityEngine/UnityEngine.UnityConnectModule.dll</HintPath>
     </Reference>
     <Reference Include="UnityEngine.WebModule">
-      <HintPath>C:/Apps/Unity/Editor/Data/Managed/UnityEngine/UnityEngine.WebModule.dll</HintPath>
+      <HintPath>C:/Apps/Unity2017.4.3/Editor/Data/Managed/UnityEngine/UnityEngine.WebModule.dll</HintPath>
     </Reference>
     <Reference Include="UnityEngine.ARModule">
-      <HintPath>C:/Apps/Unity/Editor/Data/Managed/UnityEngine/UnityEngine.ARModule.dll</HintPath>
+      <HintPath>C:/Apps/Unity2017.4.3/Editor/Data/Managed/UnityEngine/UnityEngine.ARModule.dll</HintPath>
     </Reference>
     <Reference Include="UnityEngine.VRModule">
-      <HintPath>C:/Apps/Unity/Editor/Data/Managed/UnityEngine/UnityEngine.VRModule.dll</HintPath>
+      <HintPath>C:/Apps/Unity2017.4.3/Editor/Data/Managed/UnityEngine/UnityEngine.VRModule.dll</HintPath>
     </Reference>
     <Reference Include="UnityEngine.UIElementsModule">
-      <HintPath>C:/Apps/Unity/Editor/Data/Managed/UnityEngine/UnityEngine.UIElementsModule.dll</HintPath>
+      <HintPath>C:/Apps/Unity2017.4.3/Editor/Data/Managed/UnityEngine/UnityEngine.UIElementsModule.dll</HintPath>
     </Reference>
     <Reference Include="UnityEngine.StyleSheetsModule">
-      <HintPath>C:/Apps/Unity/Editor/Data/Managed/UnityEngine/UnityEngine.StyleSheetsModule.dll</HintPath>
+      <HintPath>C:/Apps/Unity2017.4.3/Editor/Data/Managed/UnityEngine/UnityEngine.StyleSheetsModule.dll</HintPath>
     </Reference>
     <Reference Include="UnityEngine.AssetBundleModule">
-      <HintPath>C:/Apps/Unity/Editor/Data/Managed/UnityEngine/UnityEngine.AssetBundleModule.dll</HintPath>
+      <HintPath>C:/Apps/Unity2017.4.3/Editor/Data/Managed/UnityEngine/UnityEngine.AssetBundleModule.dll</HintPath>
     </Reference>
     <Reference Include="UnityEngine.AudioModule">
-      <HintPath>C:/Apps/Unity/Editor/Data/Managed/UnityEngine/UnityEngine.AudioModule.dll</HintPath>
+      <HintPath>C:/Apps/Unity2017.4.3/Editor/Data/Managed/UnityEngine/UnityEngine.AudioModule.dll</HintPath>
     </Reference>
     <Reference Include="UnityEngine.CrashReportingModule">
-      <HintPath>C:/Apps/Unity/Editor/Data/Managed/UnityEngine/UnityEngine.CrashReportingModule.dll</HintPath>
+      <HintPath>C:/Apps/Unity2017.4.3/Editor/Data/Managed/UnityEngine/UnityEngine.CrashReportingModule.dll</HintPath>
     </Reference>
     <Reference Include="UnityEngine.GameCenterModule">
-      <HintPath>C:/Apps/Unity/Editor/Data/Managed/UnityEngine/UnityEngine.GameCenterModule.dll</HintPath>
+      <HintPath>C:/Apps/Unity2017.4.3/Editor/Data/Managed/UnityEngine/UnityEngine.GameCenterModule.dll</HintPath>
     </Reference>
     <Reference Include="UnityEngine.GridModule">
-      <HintPath>C:/Apps/Unity/Editor/Data/Managed/UnityEngine/UnityEngine.GridModule.dll</HintPath>
+      <HintPath>C:/Apps/Unity2017.4.3/Editor/Data/Managed/UnityEngine/UnityEngine.GridModule.dll</HintPath>
     </Reference>
     <Reference Include="UnityEngine.ImageConversionModule">
-      <HintPath>C:/Apps/Unity/Editor/Data/Managed/UnityEngine/UnityEngine.ImageConversionModule.dll</HintPath>
+      <HintPath>C:/Apps/Unity2017.4.3/Editor/Data/Managed/UnityEngine/UnityEngine.ImageConversionModule.dll</HintPath>
     </Reference>
     <Reference Include="UnityEngine.InputModule">
-      <HintPath>C:/Apps/Unity/Editor/Data/Managed/UnityEngine/UnityEngine.InputModule.dll</HintPath>
+      <HintPath>C:/Apps/Unity2017.4.3/Editor/Data/Managed/UnityEngine/UnityEngine.InputModule.dll</HintPath>
     </Reference>
     <Reference Include="UnityEngine.JSONSerializeModule">
-      <HintPath>C:/Apps/Unity/Editor/Data/Managed/UnityEngine/UnityEngine.JSONSerializeModule.dll</HintPath>
+      <HintPath>C:/Apps/Unity2017.4.3/Editor/Data/Managed/UnityEngine/UnityEngine.JSONSerializeModule.dll</HintPath>
     </Reference>
     <Reference Include="UnityEngine.ParticlesLegacyModule">
-      <HintPath>C:/Apps/Unity/Editor/Data/Managed/UnityEngine/UnityEngine.ParticlesLegacyModule.dll</HintPath>
+      <HintPath>C:/Apps/Unity2017.4.3/Editor/Data/Managed/UnityEngine/UnityEngine.ParticlesLegacyModule.dll</HintPath>
     </Reference>
     <Reference Include="UnityEngine.Physics2DModule">
-      <HintPath>C:/Apps/Unity/Editor/Data/Managed/UnityEngine/UnityEngine.Physics2DModule.dll</HintPath>
+      <HintPath>C:/Apps/Unity2017.4.3/Editor/Data/Managed/UnityEngine/UnityEngine.Physics2DModule.dll</HintPath>
     </Reference>
     <Reference Include="UnityEngine.ScreenCaptureModule">
-      <HintPath>C:/Apps/Unity/Editor/Data/Managed/UnityEngine/UnityEngine.ScreenCaptureModule.dll</HintPath>
+      <HintPath>C:/Apps/Unity2017.4.3/Editor/Data/Managed/UnityEngine/UnityEngine.ScreenCaptureModule.dll</HintPath>
     </Reference>
     <Reference Include="UnityEngine.SharedInternalsModule">
-      <HintPath>C:/Apps/Unity/Editor/Data/Managed/UnityEngine/UnityEngine.SharedInternalsModule.dll</HintPath>
+      <HintPath>C:/Apps/Unity2017.4.3/Editor/Data/Managed/UnityEngine/UnityEngine.SharedInternalsModule.dll</HintPath>
     </Reference>
     <Reference Include="UnityEngine.SpriteMaskModule">
-      <HintPath>C:/Apps/Unity/Editor/Data/Managed/UnityEngine/UnityEngine.SpriteMaskModule.dll</HintPath>
+      <HintPath>C:/Apps/Unity2017.4.3/Editor/Data/Managed/UnityEngine/UnityEngine.SpriteMaskModule.dll</HintPath>
     </Reference>
     <Reference Include="UnityEngine.SpriteShapeModule">
-      <HintPath>C:/Apps/Unity/Editor/Data/Managed/UnityEngine/UnityEngine.SpriteShapeModule.dll</HintPath>
+      <HintPath>C:/Apps/Unity2017.4.3/Editor/Data/Managed/UnityEngine/UnityEngine.SpriteShapeModule.dll</HintPath>
     </Reference>
     <Reference Include="UnityEngine.TerrainModule">
-      <HintPath>C:/Apps/Unity/Editor/Data/Managed/UnityEngine/UnityEngine.TerrainModule.dll</HintPath>
+      <HintPath>C:/Apps/Unity2017.4.3/Editor/Data/Managed/UnityEngine/UnityEngine.TerrainModule.dll</HintPath>
     </Reference>
     <Reference Include="UnityEngine.TilemapModule">
-      <HintPath>C:/Apps/Unity/Editor/Data/Managed/UnityEngine/UnityEngine.TilemapModule.dll</HintPath>
+      <HintPath>C:/Apps/Unity2017.4.3/Editor/Data/Managed/UnityEngine/UnityEngine.TilemapModule.dll</HintPath>
     </Reference>
     <Reference Include="UnityEngine.UnityWebRequestModule">
-      <HintPath>C:/Apps/Unity/Editor/Data/Managed/UnityEngine/UnityEngine.UnityWebRequestModule.dll</HintPath>
+      <HintPath>C:/Apps/Unity2017.4.3/Editor/Data/Managed/UnityEngine/UnityEngine.UnityWebRequestModule.dll</HintPath>
     </Reference>
     <Reference Include="UnityEngine.UnityWebRequestAudioModule">
-      <HintPath>C:/Apps/Unity/Editor/Data/Managed/UnityEngine/UnityEngine.UnityWebRequestAudioModule.dll</HintPath>
+      <HintPath>C:/Apps/Unity2017.4.3/Editor/Data/Managed/UnityEngine/UnityEngine.UnityWebRequestAudioModule.dll</HintPath>
     </Reference>
     <Reference Include="UnityEngine.UnityWebRequestTextureModule">
-      <HintPath>C:/Apps/Unity/Editor/Data/Managed/UnityEngine/UnityEngine.UnityWebRequestTextureModule.dll</HintPath>
+      <HintPath>C:/Apps/Unity2017.4.3/Editor/Data/Managed/UnityEngine/UnityEngine.UnityWebRequestTextureModule.dll</HintPath>
     </Reference>
     <Reference Include="UnityEngine.UnityWebRequestWWWModule">
-      <HintPath>C:/Apps/Unity/Editor/Data/Managed/UnityEngine/UnityEngine.UnityWebRequestWWWModule.dll</HintPath>
+      <HintPath>C:/Apps/Unity2017.4.3/Editor/Data/Managed/UnityEngine/UnityEngine.UnityWebRequestWWWModule.dll</HintPath>
     </Reference>
     <Reference Include="UnityEngine.VideoModule">
-      <HintPath>C:/Apps/Unity/Editor/Data/Managed/UnityEngine/UnityEngine.VideoModule.dll</HintPath>
+      <HintPath>C:/Apps/Unity2017.4.3/Editor/Data/Managed/UnityEngine/UnityEngine.VideoModule.dll</HintPath>
     </Reference>
     <Reference Include="UnityEngine.WindModule">
-      <HintPath>C:/Apps/Unity/Editor/Data/Managed/UnityEngine/UnityEngine.WindModule.dll</HintPath>
+      <HintPath>C:/Apps/Unity2017.4.3/Editor/Data/Managed/UnityEngine/UnityEngine.WindModule.dll</HintPath>
     </Reference>
     <Reference Include="UnityEngine.UI">
-      <HintPath>C:/Apps/Unity/Editor/Data/UnityExtensions/Unity/GUISystem/UnityEngine.UI.dll</HintPath>
+      <HintPath>C:/Apps/Unity2017.4.3/Editor/Data/UnityExtensions/Unity/GUISystem/UnityEngine.UI.dll</HintPath>
     </Reference>
     <Reference Include="UnityEngine.Networking">
-      <HintPath>C:/Apps/Unity/Editor/Data/UnityExtensions/Unity/Networking/UnityEngine.Networking.dll</HintPath>
+      <HintPath>C:/Apps/Unity2017.4.3/Editor/Data/UnityExtensions/Unity/Networking/UnityEngine.Networking.dll</HintPath>
     </Reference>
     <Reference Include="UnityEngine.TestRunner">
-      <HintPath>C:/Apps/Unity/Editor/Data/UnityExtensions/Unity/TestRunner/UnityEngine.TestRunner.dll</HintPath>
+      <HintPath>C:/Apps/Unity2017.4.3/Editor/Data/UnityExtensions/Unity/TestRunner/UnityEngine.TestRunner.dll</HintPath>
     </Reference>
     <Reference Include="nunit.framework">
-      <HintPath>C:/Apps/Unity/Editor/Data/UnityExtensions/Unity/TestRunner/net35/unity-custom/nunit.framework.dll</HintPath>
+      <HintPath>C:/Apps/Unity2017.4.3/Editor/Data/UnityExtensions/Unity/TestRunner/net35/unity-custom/nunit.framework.dll</HintPath>
     </Reference>
     <Reference Include="UnityEngine.Timeline">
-      <HintPath>C:/Apps/Unity/Editor/Data/UnityExtensions/Unity/Timeline/RuntimeEditor/UnityEngine.Timeline.dll</HintPath>
+      <HintPath>C:/Apps/Unity2017.4.3/Editor/Data/UnityExtensions/Unity/Timeline/RuntimeEditor/UnityEngine.Timeline.dll</HintPath>
     </Reference>
     <Reference Include="UnityEngine.UIAutomation">
-      <HintPath>C:/Apps/Unity/Editor/Data/UnityExtensions/Unity/UIAutomation/UnityEngine.UIAutomation.dll</HintPath>
+      <HintPath>C:/Apps/Unity2017.4.3/Editor/Data/UnityExtensions/Unity/UIAutomation/UnityEngine.UIAutomation.dll</HintPath>
     </Reference>
     <Reference Include="UnityEngine.GoogleAudioSpatializer">
-      <HintPath>C:/Apps/Unity/Editor/Data/UnityExtensions/Unity/UnityGoogleAudioSpatializer/RuntimeEditor/UnityEngine.GoogleAudioSpatializer.dll</HintPath>
+      <HintPath>C:/Apps/Unity2017.4.3/Editor/Data/UnityExtensions/Unity/UnityGoogleAudioSpatializer/RuntimeEditor/UnityEngine.GoogleAudioSpatializer.dll</HintPath>
     </Reference>
     <Reference Include="UnityEngine.HoloLens">
-      <HintPath>C:/Apps/Unity/Editor/Data/UnityExtensions/Unity/UnityHoloLens/RuntimeEditor/UnityEngine.HoloLens.dll</HintPath>
+      <HintPath>C:/Apps/Unity2017.4.3/Editor/Data/UnityExtensions/Unity/UnityHoloLens/RuntimeEditor/UnityEngine.HoloLens.dll</HintPath>
     </Reference>
     <Reference Include="UnityEngine.SpatialTracking">
-      <HintPath>C:/Apps/Unity/Editor/Data/UnityExtensions/Unity/UnitySpatialTracking/RuntimeEditor/UnityEngine.SpatialTracking.dll</HintPath>
+      <HintPath>C:/Apps/Unity2017.4.3/Editor/Data/UnityExtensions/Unity/UnitySpatialTracking/RuntimeEditor/UnityEngine.SpatialTracking.dll</HintPath>
     </Reference>
     <Reference Include="ICSharpCode.SharpZipLib">
       <HintPath>Assets/Plugins/ICSharpCode.SharpZipLib.dll</HintPath>
@@ -246,13 +246,13 @@
       <HintPath>Assets/Plugins/Newtonsoft.Json.dll</HintPath>
     </Reference>
     <Reference Include="UnityEngine.Analytics">
-      <HintPath>C:/Users/tanghai/AppData/Local/Unity/cache/packages/packages.unity.com/com.unity.analytics@2.0.13/UnityEngine.Analytics.dll</HintPath>
+      <HintPath>C:/Users/USER-PC/AppData/Local/Unity/cache/packages/packages.unity.com/com.unity.analytics@2.0.13/UnityEngine.Analytics.dll</HintPath>
     </Reference>
     <Reference Include="UnityEngine.Purchasing">
-      <HintPath>C:/Users/tanghai/AppData/Local/Unity/cache/packages/packages.unity.com/com.unity.purchasing@0.0.19/UnityEngine.Purchasing.dll</HintPath>
+      <HintPath>C:/Users/USER-PC/AppData/Local/Unity/cache/packages/packages.unity.com/com.unity.purchasing@0.0.19/UnityEngine.Purchasing.dll</HintPath>
     </Reference>
     <Reference Include="UnityEngine.StandardEvents">
-      <HintPath>C:/Users/tanghai/AppData/Local/Unity/cache/packages/packages.unity.com/com.unity.standardevents@1.0.10/UnityEngine.StandardEvents.dll</HintPath>
+      <HintPath>C:/Users/USER-PC/AppData/Local/Unity/cache/packages/packages.unity.com/com.unity.standardevents@1.0.10/UnityEngine.StandardEvents.dll</HintPath>
     </Reference>
   </ItemGroup>
   <ItemGroup>

+ 78 - 74
Unity/Unity.csproj

@@ -12,13 +12,16 @@
     <ProjectTypeGuids>{E097FAD1-6243-4DAD-9C02-E9B9EFC3FFC1};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
     <TargetFrameworkIdentifier>.NETFramework</TargetFrameworkIdentifier>
     <TargetFrameworkVersion>v4.6</TargetFrameworkVersion>
-    <TargetFrameworkProfile></TargetFrameworkProfile>
-    <CompilerResponseFile></CompilerResponseFile>
+    <TargetFrameworkProfile>
+    </TargetFrameworkProfile>
+    <CompilerResponseFile>
+    </CompilerResponseFile>
     <UnityProjectGenerator>VSTU</UnityProjectGenerator>
     <UnityProjectType>Game:1</UnityProjectType>
-    <UnityBuildTarget>StandaloneWindows64:19</UnityBuildTarget>
+    <UnityBuildTarget>StandaloneWindows:5</UnityBuildTarget>
     <UnityVersion>2017.4.3f1</UnityVersion>
-    <RootNamespace></RootNamespace>
+    <RootNamespace>
+    </RootNamespace>
     <LangVersion>6</LangVersion>
   </PropertyGroup>
   <PropertyGroup>
@@ -33,7 +36,7 @@
     <IntermediateOutputPath>Temp\UnityVS_obj\Debug\</IntermediateOutputPath>
     <ErrorReport>prompt</ErrorReport>
     <WarningLevel>4</WarningLevel>
-    <DefineConstants>DEBUG;TRACE;UNITY_5_3_OR_NEWER;UNITY_5_4_OR_NEWER;UNITY_5_5_OR_NEWER;UNITY_5_6_OR_NEWER;UNITY_2017_1_OR_NEWER;UNITY_2017_2_OR_NEWER;UNITY_2017_3_OR_NEWER;UNITY_2017_4_OR_NEWER;UNITY_2017_4_3;UNITY_2017_4;UNITY_2017;PLATFORM_ARCH_64;UNITY_64;ENABLE_AUDIO;ENABLE_CACHING;ENABLE_CLOTH;ENABLE_DUCK_TYPING;ENABLE_GENERICS;ENABLE_PVR_GI;ENABLE_MICROPHONE;ENABLE_MULTIPLE_DISPLAYS;ENABLE_PHYSICS;ENABLE_SPRITERENDERER_FLIPPING;ENABLE_SPRITES;ENABLE_GRID;ENABLE_TILEMAP;ENABLE_TERRAIN;ENABLE_RAKNET;ENABLE_DIRECTOR;ENABLE_UNET;ENABLE_LZMA;ENABLE_UNITYEVENTS;ENABLE_WEBCAM;ENABLE_WWW;ENABLE_CLOUD_SERVICES_COLLAB;ENABLE_CLOUD_SERVICES_COLLAB_SOFTLOCKS;ENABLE_CLOUD_SERVICES_ADS;ENABLE_CLOUD_HUB;ENABLE_CLOUD_PROJECT_ID;ENABLE_CLOUD_SERVICES_USE_WEBREQUEST;ENABLE_CLOUD_SERVICES_UNET;ENABLE_CLOUD_SERVICES_BUILD;ENABLE_CLOUD_LICENSE;ENABLE_EDITOR_HUB;ENABLE_EDITOR_HUB_LICENSE;ENABLE_WEBSOCKET_CLIENT;ENABLE_DIRECTOR_AUDIO;ENABLE_DIRECTOR_TEXTURE;ENABLE_TIMELINE;ENABLE_EDITOR_METRICS;ENABLE_EDITOR_METRICS_CACHING;ENABLE_NATIVE_ARRAY;ENABLE_SPRITE_MASKING;INCLUDE_DYNAMIC_GI;INCLUDE_GI;ENABLE_MONO_BDWGC;PLATFORM_SUPPORTS_MONO;RENDER_SOFTWARE_CURSOR;INCLUDE_PUBNUB;ENABLE_PLAYMODE_TESTS_RUNNER;ENABLE_VIDEO;ENABLE_RMGUI;ENABLE_PACKMAN;ENABLE_CUSTOM_RENDER_TEXTURE;ENABLE_STYLE_SHEETS;ENABLE_LOCALIZATION;PLATFORM_STANDALONE_WIN;PLATFORM_STANDALONE;UNITY_STANDALONE_WIN;UNITY_STANDALONE;ENABLE_SUBSTANCE;ENABLE_RUNTIME_GI;ENABLE_MOVIES;ENABLE_NETWORK;ENABLE_CRUNCH_TEXTURE_COMPRESSION;ENABLE_UNITYWEBREQUEST;ENABLE_CLOUD_SERVICES;ENABLE_CLOUD_SERVICES_ANALYTICS;ENABLE_CLOUD_SERVICES_PURCHASING;ENABLE_CLOUD_SERVICES_CRASH_REPORTING;ENABLE_EVENT_QUEUE;ENABLE_CLUSTERINPUT;ENABLE_VR;ENABLE_AR;ENABLE_WEBSOCKET_HOST;ENABLE_MONO;NET_4_6;ENABLE_PROFILER;DEBUG;TRACE;UNITY_ASSERTIONS;UNITY_EDITOR;UNITY_EDITOR_64;UNITY_EDITOR_WIN;ENABLE_NATIVE_ARRAY_CHECKS;UNITY_TEAM_LICENSE;ENABLE_VSTU;UNITY_PRO_LICENSE;NET45;ILRuntime</DefineConstants>
+    <DefineConstants>DEBUG;TRACE;UNITY_5_3_OR_NEWER;UNITY_5_4_OR_NEWER;UNITY_5_5_OR_NEWER;UNITY_5_6_OR_NEWER;UNITY_2017_1_OR_NEWER;UNITY_2017_2_OR_NEWER;UNITY_2017_3_OR_NEWER;UNITY_2017_4_OR_NEWER;UNITY_2017_4_3;UNITY_2017_4;UNITY_2017;ENABLE_AUDIO;ENABLE_CACHING;ENABLE_CLOTH;ENABLE_DUCK_TYPING;ENABLE_GENERICS;ENABLE_PVR_GI;ENABLE_MICROPHONE;ENABLE_MULTIPLE_DISPLAYS;ENABLE_PHYSICS;ENABLE_SPRITERENDERER_FLIPPING;ENABLE_SPRITES;ENABLE_GRID;ENABLE_TILEMAP;ENABLE_TERRAIN;ENABLE_RAKNET;ENABLE_DIRECTOR;ENABLE_UNET;ENABLE_LZMA;ENABLE_UNITYEVENTS;ENABLE_WEBCAM;ENABLE_WWW;ENABLE_CLOUD_SERVICES_COLLAB;ENABLE_CLOUD_SERVICES_COLLAB_SOFTLOCKS;ENABLE_CLOUD_SERVICES_ADS;ENABLE_CLOUD_HUB;ENABLE_CLOUD_PROJECT_ID;ENABLE_CLOUD_SERVICES_USE_WEBREQUEST;ENABLE_CLOUD_SERVICES_UNET;ENABLE_CLOUD_SERVICES_BUILD;ENABLE_CLOUD_LICENSE;ENABLE_EDITOR_HUB;ENABLE_EDITOR_HUB_LICENSE;ENABLE_WEBSOCKET_CLIENT;ENABLE_DIRECTOR_AUDIO;ENABLE_DIRECTOR_TEXTURE;ENABLE_TIMELINE;ENABLE_EDITOR_METRICS;ENABLE_EDITOR_METRICS_CACHING;ENABLE_NATIVE_ARRAY;ENABLE_SPRITE_MASKING;INCLUDE_DYNAMIC_GI;INCLUDE_GI;ENABLE_MONO_BDWGC;PLATFORM_SUPPORTS_MONO;RENDER_SOFTWARE_CURSOR;INCLUDE_PUBNUB;ENABLE_PLAYMODE_TESTS_RUNNER;ENABLE_VIDEO;ENABLE_RMGUI;ENABLE_PACKMAN;ENABLE_CUSTOM_RENDER_TEXTURE;ENABLE_STYLE_SHEETS;ENABLE_LOCALIZATION;PLATFORM_STANDALONE_WIN;PLATFORM_STANDALONE;UNITY_STANDALONE_WIN;UNITY_STANDALONE;ENABLE_SUBSTANCE;ENABLE_RUNTIME_GI;ENABLE_MOVIES;ENABLE_NETWORK;ENABLE_CRUNCH_TEXTURE_COMPRESSION;ENABLE_UNITYWEBREQUEST;ENABLE_CLOUD_SERVICES;ENABLE_CLOUD_SERVICES_ANALYTICS;ENABLE_CLOUD_SERVICES_PURCHASING;ENABLE_CLOUD_SERVICES_CRASH_REPORTING;ENABLE_EVENT_QUEUE;ENABLE_CLUSTERINPUT;ENABLE_VR;ENABLE_AR;ENABLE_WEBSOCKET_HOST;ENABLE_MONO;NET_4_6;ENABLE_PROFILER;DEBUG;TRACE;UNITY_ASSERTIONS;UNITY_EDITOR;UNITY_EDITOR_64;UNITY_EDITOR_WIN;ENABLE_NATIVE_ARRAY_CHECKS;UNITY_TEAM_LICENSE;ENABLE_VSTU;UNITY_PRO_LICENSE;NET45;ILRuntime1</DefineConstants>
     <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
   </PropertyGroup>
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
@@ -43,201 +46,201 @@
     <IntermediateOutputPath>Temp\UnityVS_obj\Release\</IntermediateOutputPath>
     <ErrorReport>prompt</ErrorReport>
     <WarningLevel>4</WarningLevel>
-    <DefineConstants>TRACE;UNITY_5_3_OR_NEWER;UNITY_5_4_OR_NEWER;UNITY_5_5_OR_NEWER;UNITY_5_6_OR_NEWER;UNITY_2017_1_OR_NEWER;UNITY_2017_2_OR_NEWER;UNITY_2017_3_OR_NEWER;UNITY_2017_4_OR_NEWER;UNITY_2017_4_3;UNITY_2017_4;UNITY_2017;PLATFORM_ARCH_64;UNITY_64;ENABLE_AUDIO;ENABLE_CACHING;ENABLE_CLOTH;ENABLE_DUCK_TYPING;ENABLE_GENERICS;ENABLE_PVR_GI;ENABLE_MICROPHONE;ENABLE_MULTIPLE_DISPLAYS;ENABLE_PHYSICS;ENABLE_SPRITERENDERER_FLIPPING;ENABLE_SPRITES;ENABLE_GRID;ENABLE_TILEMAP;ENABLE_TERRAIN;ENABLE_RAKNET;ENABLE_DIRECTOR;ENABLE_UNET;ENABLE_LZMA;ENABLE_UNITYEVENTS;ENABLE_WEBCAM;ENABLE_WWW;ENABLE_CLOUD_SERVICES_COLLAB;ENABLE_CLOUD_SERVICES_COLLAB_SOFTLOCKS;ENABLE_CLOUD_SERVICES_ADS;ENABLE_CLOUD_HUB;ENABLE_CLOUD_PROJECT_ID;ENABLE_CLOUD_SERVICES_USE_WEBREQUEST;ENABLE_CLOUD_SERVICES_UNET;ENABLE_CLOUD_SERVICES_BUILD;ENABLE_CLOUD_LICENSE;ENABLE_EDITOR_HUB;ENABLE_EDITOR_HUB_LICENSE;ENABLE_WEBSOCKET_CLIENT;ENABLE_DIRECTOR_AUDIO;ENABLE_DIRECTOR_TEXTURE;ENABLE_TIMELINE;ENABLE_EDITOR_METRICS;ENABLE_EDITOR_METRICS_CACHING;ENABLE_NATIVE_ARRAY;ENABLE_SPRITE_MASKING;INCLUDE_DYNAMIC_GI;INCLUDE_GI;ENABLE_MONO_BDWGC;PLATFORM_SUPPORTS_MONO;RENDER_SOFTWARE_CURSOR;INCLUDE_PUBNUB;ENABLE_PLAYMODE_TESTS_RUNNER;ENABLE_VIDEO;ENABLE_RMGUI;ENABLE_PACKMAN;ENABLE_CUSTOM_RENDER_TEXTURE;ENABLE_STYLE_SHEETS;ENABLE_LOCALIZATION;PLATFORM_STANDALONE_WIN;PLATFORM_STANDALONE;UNITY_STANDALONE_WIN;UNITY_STANDALONE;ENABLE_SUBSTANCE;ENABLE_RUNTIME_GI;ENABLE_MOVIES;ENABLE_NETWORK;ENABLE_CRUNCH_TEXTURE_COMPRESSION;ENABLE_UNITYWEBREQUEST;ENABLE_CLOUD_SERVICES;ENABLE_CLOUD_SERVICES_ANALYTICS;ENABLE_CLOUD_SERVICES_PURCHASING;ENABLE_CLOUD_SERVICES_CRASH_REPORTING;ENABLE_EVENT_QUEUE;ENABLE_CLUSTERINPUT;ENABLE_VR;ENABLE_AR;ENABLE_WEBSOCKET_HOST;ENABLE_MONO;NET_4_6;ENABLE_PROFILER;DEBUG;TRACE;UNITY_ASSERTIONS;UNITY_EDITOR;UNITY_EDITOR_64;UNITY_EDITOR_WIN;ENABLE_NATIVE_ARRAY_CHECKS;UNITY_TEAM_LICENSE;ENABLE_VSTU;UNITY_PRO_LICENSE;NET45;ILRuntime</DefineConstants>
+    <DefineConstants>TRACE;UNITY_5_3_OR_NEWER;UNITY_5_4_OR_NEWER;UNITY_5_5_OR_NEWER;UNITY_5_6_OR_NEWER;UNITY_2017_1_OR_NEWER;UNITY_2017_2_OR_NEWER;UNITY_2017_3_OR_NEWER;UNITY_2017_4_OR_NEWER;UNITY_2017_4_3;UNITY_2017_4;UNITY_2017;ENABLE_AUDIO;ENABLE_CACHING;ENABLE_CLOTH;ENABLE_DUCK_TYPING;ENABLE_GENERICS;ENABLE_PVR_GI;ENABLE_MICROPHONE;ENABLE_MULTIPLE_DISPLAYS;ENABLE_PHYSICS;ENABLE_SPRITERENDERER_FLIPPING;ENABLE_SPRITES;ENABLE_GRID;ENABLE_TILEMAP;ENABLE_TERRAIN;ENABLE_RAKNET;ENABLE_DIRECTOR;ENABLE_UNET;ENABLE_LZMA;ENABLE_UNITYEVENTS;ENABLE_WEBCAM;ENABLE_WWW;ENABLE_CLOUD_SERVICES_COLLAB;ENABLE_CLOUD_SERVICES_COLLAB_SOFTLOCKS;ENABLE_CLOUD_SERVICES_ADS;ENABLE_CLOUD_HUB;ENABLE_CLOUD_PROJECT_ID;ENABLE_CLOUD_SERVICES_USE_WEBREQUEST;ENABLE_CLOUD_SERVICES_UNET;ENABLE_CLOUD_SERVICES_BUILD;ENABLE_CLOUD_LICENSE;ENABLE_EDITOR_HUB;ENABLE_EDITOR_HUB_LICENSE;ENABLE_WEBSOCKET_CLIENT;ENABLE_DIRECTOR_AUDIO;ENABLE_DIRECTOR_TEXTURE;ENABLE_TIMELINE;ENABLE_EDITOR_METRICS;ENABLE_EDITOR_METRICS_CACHING;ENABLE_NATIVE_ARRAY;ENABLE_SPRITE_MASKING;INCLUDE_DYNAMIC_GI;INCLUDE_GI;ENABLE_MONO_BDWGC;PLATFORM_SUPPORTS_MONO;RENDER_SOFTWARE_CURSOR;INCLUDE_PUBNUB;ENABLE_PLAYMODE_TESTS_RUNNER;ENABLE_VIDEO;ENABLE_RMGUI;ENABLE_PACKMAN;ENABLE_CUSTOM_RENDER_TEXTURE;ENABLE_STYLE_SHEETS;ENABLE_LOCALIZATION;PLATFORM_STANDALONE_WIN;PLATFORM_STANDALONE;UNITY_STANDALONE_WIN;UNITY_STANDALONE;ENABLE_SUBSTANCE;ENABLE_RUNTIME_GI;ENABLE_MOVIES;ENABLE_NETWORK;ENABLE_CRUNCH_TEXTURE_COMPRESSION;ENABLE_UNITYWEBREQUEST;ENABLE_CLOUD_SERVICES;ENABLE_CLOUD_SERVICES_ANALYTICS;ENABLE_CLOUD_SERVICES_PURCHASING;ENABLE_CLOUD_SERVICES_CRASH_REPORTING;ENABLE_EVENT_QUEUE;ENABLE_CLUSTERINPUT;ENABLE_VR;ENABLE_AR;ENABLE_WEBSOCKET_HOST;ENABLE_MONO;NET_4_6;ENABLE_PROFILER;DEBUG;TRACE;UNITY_ASSERTIONS;UNITY_EDITOR;UNITY_EDITOR_64;UNITY_EDITOR_WIN;ENABLE_NATIVE_ARRAY_CHECKS;UNITY_TEAM_LICENSE;ENABLE_VSTU;UNITY_PRO_LICENSE;NET45;ILRuntime1</DefineConstants>
     <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
   </PropertyGroup>
   <ItemGroup>
     <Reference Include="mscorlib">
-      <HintPath>C:\Apps\Unity\Editor\Data\MonoBleedingEdge\lib\mono\4.6-api\mscorlib.dll</HintPath>
+      <HintPath>C:\Apps\Unity2017.4.3\Editor\Data\MonoBleedingEdge\lib\mono\4.6-api\mscorlib.dll</HintPath>
     </Reference>
     <Reference Include="System">
-      <HintPath>C:\Apps\Unity\Editor\Data\MonoBleedingEdge\lib\mono\4.6-api\System.dll</HintPath>
+      <HintPath>C:\Apps\Unity2017.4.3\Editor\Data\MonoBleedingEdge\lib\mono\4.6-api\System.dll</HintPath>
     </Reference>
     <Reference Include="System.XML">
-      <HintPath>C:\Apps\Unity\Editor\Data\MonoBleedingEdge\lib\mono\4.6-api\System.XML.dll</HintPath>
+      <HintPath>C:\Apps\Unity2017.4.3\Editor\Data\MonoBleedingEdge\lib\mono\4.6-api\System.XML.dll</HintPath>
     </Reference>
     <Reference Include="System.Core">
-      <HintPath>C:\Apps\Unity\Editor\Data\MonoBleedingEdge\lib\mono\4.6-api\System.Core.dll</HintPath>
+      <HintPath>C:\Apps\Unity2017.4.3\Editor\Data\MonoBleedingEdge\lib\mono\4.6-api\System.Core.dll</HintPath>
     </Reference>
     <Reference Include="Microsoft.CSharp">
-      <HintPath>C:\Apps\Unity\Editor\Data\MonoBleedingEdge\lib\mono\4.6-api\Microsoft.CSharp.dll</HintPath>
+      <HintPath>C:\Apps\Unity2017.4.3\Editor\Data\MonoBleedingEdge\lib\mono\4.6-api\Microsoft.CSharp.dll</HintPath>
     </Reference>
     <Reference Include="System.Runtime.Serialization">
-      <HintPath>C:\Apps\Unity\Editor\Data\MonoBleedingEdge\lib\mono\4.6-api\System.Runtime.Serialization.dll</HintPath>
+      <HintPath>C:\Apps\Unity2017.4.3\Editor\Data\MonoBleedingEdge\lib\mono\4.6-api\System.Runtime.Serialization.dll</HintPath>
     </Reference>
     <Reference Include="System.Xml.Linq">
-      <HintPath>C:\Apps\Unity\Editor\Data\MonoBleedingEdge\lib\mono\4.6-api\System.Xml.Linq.dll</HintPath>
+      <HintPath>C:\Apps\Unity2017.4.3\Editor\Data\MonoBleedingEdge\lib\mono\4.6-api\System.Xml.Linq.dll</HintPath>
     </Reference>
     <Reference Include="UnityEditor">
-      <HintPath>C:/Apps/Unity/Editor/Data/Managed/UnityEditor.dll</HintPath>
+      <HintPath>C:/Apps/Unity2017.4.3/Editor/Data/Managed/UnityEditor.dll</HintPath>
     </Reference>
     <Reference Include="UnityEngine">
-      <HintPath>C:/Apps/Unity/Editor/Data/Managed/UnityEngine/UnityEngine.dll</HintPath>
+      <HintPath>C:/Apps/Unity2017.4.3/Editor/Data/Managed/UnityEngine/UnityEngine.dll</HintPath>
     </Reference>
     <Reference Include="UnityEngine.CoreModule">
-      <HintPath>C:/Apps/Unity/Editor/Data/Managed/UnityEngine/UnityEngine.CoreModule.dll</HintPath>
+      <HintPath>C:/Apps/Unity2017.4.3/Editor/Data/Managed/UnityEngine/UnityEngine.CoreModule.dll</HintPath>
     </Reference>
     <Reference Include="UnityEngine.AccessibilityModule">
-      <HintPath>C:/Apps/Unity/Editor/Data/Managed/UnityEngine/UnityEngine.AccessibilityModule.dll</HintPath>
+      <HintPath>C:/Apps/Unity2017.4.3/Editor/Data/Managed/UnityEngine/UnityEngine.AccessibilityModule.dll</HintPath>
     </Reference>
     <Reference Include="UnityEngine.ParticleSystemModule">
-      <HintPath>C:/Apps/Unity/Editor/Data/Managed/UnityEngine/UnityEngine.ParticleSystemModule.dll</HintPath>
+      <HintPath>C:/Apps/Unity2017.4.3/Editor/Data/Managed/UnityEngine/UnityEngine.ParticleSystemModule.dll</HintPath>
     </Reference>
     <Reference Include="UnityEngine.PhysicsModule">
-      <HintPath>C:/Apps/Unity/Editor/Data/Managed/UnityEngine/UnityEngine.PhysicsModule.dll</HintPath>
+      <HintPath>C:/Apps/Unity2017.4.3/Editor/Data/Managed/UnityEngine/UnityEngine.PhysicsModule.dll</HintPath>
     </Reference>
     <Reference Include="UnityEngine.VehiclesModule">
-      <HintPath>C:/Apps/Unity/Editor/Data/Managed/UnityEngine/UnityEngine.VehiclesModule.dll</HintPath>
+      <HintPath>C:/Apps/Unity2017.4.3/Editor/Data/Managed/UnityEngine/UnityEngine.VehiclesModule.dll</HintPath>
     </Reference>
     <Reference Include="UnityEngine.ClothModule">
-      <HintPath>C:/Apps/Unity/Editor/Data/Managed/UnityEngine/UnityEngine.ClothModule.dll</HintPath>
+      <HintPath>C:/Apps/Unity2017.4.3/Editor/Data/Managed/UnityEngine/UnityEngine.ClothModule.dll</HintPath>
     </Reference>
     <Reference Include="UnityEngine.AIModule">
-      <HintPath>C:/Apps/Unity/Editor/Data/Managed/UnityEngine/UnityEngine.AIModule.dll</HintPath>
+      <HintPath>C:/Apps/Unity2017.4.3/Editor/Data/Managed/UnityEngine/UnityEngine.AIModule.dll</HintPath>
     </Reference>
     <Reference Include="UnityEngine.AnimationModule">
-      <HintPath>C:/Apps/Unity/Editor/Data/Managed/UnityEngine/UnityEngine.AnimationModule.dll</HintPath>
+      <HintPath>C:/Apps/Unity2017.4.3/Editor/Data/Managed/UnityEngine/UnityEngine.AnimationModule.dll</HintPath>
     </Reference>
     <Reference Include="UnityEngine.TextRenderingModule">
-      <HintPath>C:/Apps/Unity/Editor/Data/Managed/UnityEngine/UnityEngine.TextRenderingModule.dll</HintPath>
+      <HintPath>C:/Apps/Unity2017.4.3/Editor/Data/Managed/UnityEngine/UnityEngine.TextRenderingModule.dll</HintPath>
     </Reference>
     <Reference Include="UnityEngine.UIModule">
-      <HintPath>C:/Apps/Unity/Editor/Data/Managed/UnityEngine/UnityEngine.UIModule.dll</HintPath>
+      <HintPath>C:/Apps/Unity2017.4.3/Editor/Data/Managed/UnityEngine/UnityEngine.UIModule.dll</HintPath>
     </Reference>
     <Reference Include="UnityEngine.TerrainPhysicsModule">
-      <HintPath>C:/Apps/Unity/Editor/Data/Managed/UnityEngine/UnityEngine.TerrainPhysicsModule.dll</HintPath>
+      <HintPath>C:/Apps/Unity2017.4.3/Editor/Data/Managed/UnityEngine/UnityEngine.TerrainPhysicsModule.dll</HintPath>
     </Reference>
     <Reference Include="UnityEngine.IMGUIModule">
-      <HintPath>C:/Apps/Unity/Editor/Data/Managed/UnityEngine/UnityEngine.IMGUIModule.dll</HintPath>
+      <HintPath>C:/Apps/Unity2017.4.3/Editor/Data/Managed/UnityEngine/UnityEngine.IMGUIModule.dll</HintPath>
     </Reference>
     <Reference Include="UnityEngine.ClusterInputModule">
-      <HintPath>C:/Apps/Unity/Editor/Data/Managed/UnityEngine/UnityEngine.ClusterInputModule.dll</HintPath>
+      <HintPath>C:/Apps/Unity2017.4.3/Editor/Data/Managed/UnityEngine/UnityEngine.ClusterInputModule.dll</HintPath>
     </Reference>
     <Reference Include="UnityEngine.ClusterRendererModule">
-      <HintPath>C:/Apps/Unity/Editor/Data/Managed/UnityEngine/UnityEngine.ClusterRendererModule.dll</HintPath>
+      <HintPath>C:/Apps/Unity2017.4.3/Editor/Data/Managed/UnityEngine/UnityEngine.ClusterRendererModule.dll</HintPath>
     </Reference>
     <Reference Include="UnityEngine.UNETModule">
-      <HintPath>C:/Apps/Unity/Editor/Data/Managed/UnityEngine/UnityEngine.UNETModule.dll</HintPath>
+      <HintPath>C:/Apps/Unity2017.4.3/Editor/Data/Managed/UnityEngine/UnityEngine.UNETModule.dll</HintPath>
     </Reference>
     <Reference Include="UnityEngine.DirectorModule">
-      <HintPath>C:/Apps/Unity/Editor/Data/Managed/UnityEngine/UnityEngine.DirectorModule.dll</HintPath>
+      <HintPath>C:/Apps/Unity2017.4.3/Editor/Data/Managed/UnityEngine/UnityEngine.DirectorModule.dll</HintPath>
     </Reference>
     <Reference Include="UnityEngine.UnityAnalyticsModule">
-      <HintPath>C:/Apps/Unity/Editor/Data/Managed/UnityEngine/UnityEngine.UnityAnalyticsModule.dll</HintPath>
+      <HintPath>C:/Apps/Unity2017.4.3/Editor/Data/Managed/UnityEngine/UnityEngine.UnityAnalyticsModule.dll</HintPath>
     </Reference>
     <Reference Include="UnityEngine.PerformanceReportingModule">
-      <HintPath>C:/Apps/Unity/Editor/Data/Managed/UnityEngine/UnityEngine.PerformanceReportingModule.dll</HintPath>
+      <HintPath>C:/Apps/Unity2017.4.3/Editor/Data/Managed/UnityEngine/UnityEngine.PerformanceReportingModule.dll</HintPath>
     </Reference>
     <Reference Include="UnityEngine.UnityConnectModule">
-      <HintPath>C:/Apps/Unity/Editor/Data/Managed/UnityEngine/UnityEngine.UnityConnectModule.dll</HintPath>
+      <HintPath>C:/Apps/Unity2017.4.3/Editor/Data/Managed/UnityEngine/UnityEngine.UnityConnectModule.dll</HintPath>
     </Reference>
     <Reference Include="UnityEngine.WebModule">
-      <HintPath>C:/Apps/Unity/Editor/Data/Managed/UnityEngine/UnityEngine.WebModule.dll</HintPath>
+      <HintPath>C:/Apps/Unity2017.4.3/Editor/Data/Managed/UnityEngine/UnityEngine.WebModule.dll</HintPath>
     </Reference>
     <Reference Include="UnityEngine.ARModule">
-      <HintPath>C:/Apps/Unity/Editor/Data/Managed/UnityEngine/UnityEngine.ARModule.dll</HintPath>
+      <HintPath>C:/Apps/Unity2017.4.3/Editor/Data/Managed/UnityEngine/UnityEngine.ARModule.dll</HintPath>
     </Reference>
     <Reference Include="UnityEngine.VRModule">
-      <HintPath>C:/Apps/Unity/Editor/Data/Managed/UnityEngine/UnityEngine.VRModule.dll</HintPath>
+      <HintPath>C:/Apps/Unity2017.4.3/Editor/Data/Managed/UnityEngine/UnityEngine.VRModule.dll</HintPath>
     </Reference>
     <Reference Include="UnityEngine.UIElementsModule">
-      <HintPath>C:/Apps/Unity/Editor/Data/Managed/UnityEngine/UnityEngine.UIElementsModule.dll</HintPath>
+      <HintPath>C:/Apps/Unity2017.4.3/Editor/Data/Managed/UnityEngine/UnityEngine.UIElementsModule.dll</HintPath>
     </Reference>
     <Reference Include="UnityEngine.StyleSheetsModule">
-      <HintPath>C:/Apps/Unity/Editor/Data/Managed/UnityEngine/UnityEngine.StyleSheetsModule.dll</HintPath>
+      <HintPath>C:/Apps/Unity2017.4.3/Editor/Data/Managed/UnityEngine/UnityEngine.StyleSheetsModule.dll</HintPath>
     </Reference>
     <Reference Include="UnityEngine.AssetBundleModule">
-      <HintPath>C:/Apps/Unity/Editor/Data/Managed/UnityEngine/UnityEngine.AssetBundleModule.dll</HintPath>
+      <HintPath>C:/Apps/Unity2017.4.3/Editor/Data/Managed/UnityEngine/UnityEngine.AssetBundleModule.dll</HintPath>
     </Reference>
     <Reference Include="UnityEngine.AudioModule">
-      <HintPath>C:/Apps/Unity/Editor/Data/Managed/UnityEngine/UnityEngine.AudioModule.dll</HintPath>
+      <HintPath>C:/Apps/Unity2017.4.3/Editor/Data/Managed/UnityEngine/UnityEngine.AudioModule.dll</HintPath>
     </Reference>
     <Reference Include="UnityEngine.CrashReportingModule">
-      <HintPath>C:/Apps/Unity/Editor/Data/Managed/UnityEngine/UnityEngine.CrashReportingModule.dll</HintPath>
+      <HintPath>C:/Apps/Unity2017.4.3/Editor/Data/Managed/UnityEngine/UnityEngine.CrashReportingModule.dll</HintPath>
     </Reference>
     <Reference Include="UnityEngine.GameCenterModule">
-      <HintPath>C:/Apps/Unity/Editor/Data/Managed/UnityEngine/UnityEngine.GameCenterModule.dll</HintPath>
+      <HintPath>C:/Apps/Unity2017.4.3/Editor/Data/Managed/UnityEngine/UnityEngine.GameCenterModule.dll</HintPath>
     </Reference>
     <Reference Include="UnityEngine.GridModule">
-      <HintPath>C:/Apps/Unity/Editor/Data/Managed/UnityEngine/UnityEngine.GridModule.dll</HintPath>
+      <HintPath>C:/Apps/Unity2017.4.3/Editor/Data/Managed/UnityEngine/UnityEngine.GridModule.dll</HintPath>
     </Reference>
     <Reference Include="UnityEngine.ImageConversionModule">
-      <HintPath>C:/Apps/Unity/Editor/Data/Managed/UnityEngine/UnityEngine.ImageConversionModule.dll</HintPath>
+      <HintPath>C:/Apps/Unity2017.4.3/Editor/Data/Managed/UnityEngine/UnityEngine.ImageConversionModule.dll</HintPath>
     </Reference>
     <Reference Include="UnityEngine.InputModule">
-      <HintPath>C:/Apps/Unity/Editor/Data/Managed/UnityEngine/UnityEngine.InputModule.dll</HintPath>
+      <HintPath>C:/Apps/Unity2017.4.3/Editor/Data/Managed/UnityEngine/UnityEngine.InputModule.dll</HintPath>
     </Reference>
     <Reference Include="UnityEngine.JSONSerializeModule">
-      <HintPath>C:/Apps/Unity/Editor/Data/Managed/UnityEngine/UnityEngine.JSONSerializeModule.dll</HintPath>
+      <HintPath>C:/Apps/Unity2017.4.3/Editor/Data/Managed/UnityEngine/UnityEngine.JSONSerializeModule.dll</HintPath>
     </Reference>
     <Reference Include="UnityEngine.ParticlesLegacyModule">
-      <HintPath>C:/Apps/Unity/Editor/Data/Managed/UnityEngine/UnityEngine.ParticlesLegacyModule.dll</HintPath>
+      <HintPath>C:/Apps/Unity2017.4.3/Editor/Data/Managed/UnityEngine/UnityEngine.ParticlesLegacyModule.dll</HintPath>
     </Reference>
     <Reference Include="UnityEngine.Physics2DModule">
-      <HintPath>C:/Apps/Unity/Editor/Data/Managed/UnityEngine/UnityEngine.Physics2DModule.dll</HintPath>
+      <HintPath>C:/Apps/Unity2017.4.3/Editor/Data/Managed/UnityEngine/UnityEngine.Physics2DModule.dll</HintPath>
     </Reference>
     <Reference Include="UnityEngine.ScreenCaptureModule">
-      <HintPath>C:/Apps/Unity/Editor/Data/Managed/UnityEngine/UnityEngine.ScreenCaptureModule.dll</HintPath>
+      <HintPath>C:/Apps/Unity2017.4.3/Editor/Data/Managed/UnityEngine/UnityEngine.ScreenCaptureModule.dll</HintPath>
     </Reference>
     <Reference Include="UnityEngine.SharedInternalsModule">
-      <HintPath>C:/Apps/Unity/Editor/Data/Managed/UnityEngine/UnityEngine.SharedInternalsModule.dll</HintPath>
+      <HintPath>C:/Apps/Unity2017.4.3/Editor/Data/Managed/UnityEngine/UnityEngine.SharedInternalsModule.dll</HintPath>
     </Reference>
     <Reference Include="UnityEngine.SpriteMaskModule">
-      <HintPath>C:/Apps/Unity/Editor/Data/Managed/UnityEngine/UnityEngine.SpriteMaskModule.dll</HintPath>
+      <HintPath>C:/Apps/Unity2017.4.3/Editor/Data/Managed/UnityEngine/UnityEngine.SpriteMaskModule.dll</HintPath>
     </Reference>
     <Reference Include="UnityEngine.SpriteShapeModule">
-      <HintPath>C:/Apps/Unity/Editor/Data/Managed/UnityEngine/UnityEngine.SpriteShapeModule.dll</HintPath>
+      <HintPath>C:/Apps/Unity2017.4.3/Editor/Data/Managed/UnityEngine/UnityEngine.SpriteShapeModule.dll</HintPath>
     </Reference>
     <Reference Include="UnityEngine.TerrainModule">
-      <HintPath>C:/Apps/Unity/Editor/Data/Managed/UnityEngine/UnityEngine.TerrainModule.dll</HintPath>
+      <HintPath>C:/Apps/Unity2017.4.3/Editor/Data/Managed/UnityEngine/UnityEngine.TerrainModule.dll</HintPath>
     </Reference>
     <Reference Include="UnityEngine.TilemapModule">
-      <HintPath>C:/Apps/Unity/Editor/Data/Managed/UnityEngine/UnityEngine.TilemapModule.dll</HintPath>
+      <HintPath>C:/Apps/Unity2017.4.3/Editor/Data/Managed/UnityEngine/UnityEngine.TilemapModule.dll</HintPath>
     </Reference>
     <Reference Include="UnityEngine.UnityWebRequestModule">
-      <HintPath>C:/Apps/Unity/Editor/Data/Managed/UnityEngine/UnityEngine.UnityWebRequestModule.dll</HintPath>
+      <HintPath>C:/Apps/Unity2017.4.3/Editor/Data/Managed/UnityEngine/UnityEngine.UnityWebRequestModule.dll</HintPath>
     </Reference>
     <Reference Include="UnityEngine.UnityWebRequestAudioModule">
-      <HintPath>C:/Apps/Unity/Editor/Data/Managed/UnityEngine/UnityEngine.UnityWebRequestAudioModule.dll</HintPath>
+      <HintPath>C:/Apps/Unity2017.4.3/Editor/Data/Managed/UnityEngine/UnityEngine.UnityWebRequestAudioModule.dll</HintPath>
     </Reference>
     <Reference Include="UnityEngine.UnityWebRequestTextureModule">
-      <HintPath>C:/Apps/Unity/Editor/Data/Managed/UnityEngine/UnityEngine.UnityWebRequestTextureModule.dll</HintPath>
+      <HintPath>C:/Apps/Unity2017.4.3/Editor/Data/Managed/UnityEngine/UnityEngine.UnityWebRequestTextureModule.dll</HintPath>
     </Reference>
     <Reference Include="UnityEngine.UnityWebRequestWWWModule">
-      <HintPath>C:/Apps/Unity/Editor/Data/Managed/UnityEngine/UnityEngine.UnityWebRequestWWWModule.dll</HintPath>
+      <HintPath>C:/Apps/Unity2017.4.3/Editor/Data/Managed/UnityEngine/UnityEngine.UnityWebRequestWWWModule.dll</HintPath>
     </Reference>
     <Reference Include="UnityEngine.VideoModule">
-      <HintPath>C:/Apps/Unity/Editor/Data/Managed/UnityEngine/UnityEngine.VideoModule.dll</HintPath>
+      <HintPath>C:/Apps/Unity2017.4.3/Editor/Data/Managed/UnityEngine/UnityEngine.VideoModule.dll</HintPath>
     </Reference>
     <Reference Include="UnityEngine.WindModule">
-      <HintPath>C:/Apps/Unity/Editor/Data/Managed/UnityEngine/UnityEngine.WindModule.dll</HintPath>
+      <HintPath>C:/Apps/Unity2017.4.3/Editor/Data/Managed/UnityEngine/UnityEngine.WindModule.dll</HintPath>
     </Reference>
     <Reference Include="UnityEngine.UI">
-      <HintPath>C:/Apps/Unity/Editor/Data/UnityExtensions/Unity/GUISystem/UnityEngine.UI.dll</HintPath>
+      <HintPath>C:/Apps/Unity2017.4.3/Editor/Data/UnityExtensions/Unity/GUISystem/UnityEngine.UI.dll</HintPath>
     </Reference>
     <Reference Include="UnityEngine.Networking">
-      <HintPath>C:/Apps/Unity/Editor/Data/UnityExtensions/Unity/Networking/UnityEngine.Networking.dll</HintPath>
+      <HintPath>C:/Apps/Unity2017.4.3/Editor/Data/UnityExtensions/Unity/Networking/UnityEngine.Networking.dll</HintPath>
     </Reference>
     <Reference Include="UnityEngine.TestRunner">
-      <HintPath>C:/Apps/Unity/Editor/Data/UnityExtensions/Unity/TestRunner/UnityEngine.TestRunner.dll</HintPath>
+      <HintPath>C:/Apps/Unity2017.4.3/Editor/Data/UnityExtensions/Unity/TestRunner/UnityEngine.TestRunner.dll</HintPath>
     </Reference>
     <Reference Include="nunit.framework">
-      <HintPath>C:/Apps/Unity/Editor/Data/UnityExtensions/Unity/TestRunner/net35/unity-custom/nunit.framework.dll</HintPath>
+      <HintPath>C:/Apps/Unity2017.4.3/Editor/Data/UnityExtensions/Unity/TestRunner/net35/unity-custom/nunit.framework.dll</HintPath>
     </Reference>
     <Reference Include="UnityEngine.Timeline">
-      <HintPath>C:/Apps/Unity/Editor/Data/UnityExtensions/Unity/Timeline/RuntimeEditor/UnityEngine.Timeline.dll</HintPath>
+      <HintPath>C:/Apps/Unity2017.4.3/Editor/Data/UnityExtensions/Unity/Timeline/RuntimeEditor/UnityEngine.Timeline.dll</HintPath>
     </Reference>
     <Reference Include="UnityEngine.UIAutomation">
-      <HintPath>C:/Apps/Unity/Editor/Data/UnityExtensions/Unity/UIAutomation/UnityEngine.UIAutomation.dll</HintPath>
+      <HintPath>C:/Apps/Unity2017.4.3/Editor/Data/UnityExtensions/Unity/UIAutomation/UnityEngine.UIAutomation.dll</HintPath>
     </Reference>
     <Reference Include="UnityEngine.GoogleAudioSpatializer">
-      <HintPath>C:/Apps/Unity/Editor/Data/UnityExtensions/Unity/UnityGoogleAudioSpatializer/RuntimeEditor/UnityEngine.GoogleAudioSpatializer.dll</HintPath>
+      <HintPath>C:/Apps/Unity2017.4.3/Editor/Data/UnityExtensions/Unity/UnityGoogleAudioSpatializer/RuntimeEditor/UnityEngine.GoogleAudioSpatializer.dll</HintPath>
     </Reference>
     <Reference Include="UnityEngine.HoloLens">
-      <HintPath>C:/Apps/Unity/Editor/Data/UnityExtensions/Unity/UnityHoloLens/RuntimeEditor/UnityEngine.HoloLens.dll</HintPath>
+      <HintPath>C:/Apps/Unity2017.4.3/Editor/Data/UnityExtensions/Unity/UnityHoloLens/RuntimeEditor/UnityEngine.HoloLens.dll</HintPath>
     </Reference>
     <Reference Include="UnityEngine.SpatialTracking">
-      <HintPath>C:/Apps/Unity/Editor/Data/UnityExtensions/Unity/UnitySpatialTracking/RuntimeEditor/UnityEngine.SpatialTracking.dll</HintPath>
+      <HintPath>C:/Apps/Unity2017.4.3/Editor/Data/UnityExtensions/Unity/UnitySpatialTracking/RuntimeEditor/UnityEngine.SpatialTracking.dll</HintPath>
     </Reference>
     <Reference Include="ICSharpCode.SharpZipLib">
       <HintPath>Assets/Plugins/ICSharpCode.SharpZipLib.dll</HintPath>
@@ -246,13 +249,13 @@
       <HintPath>Assets/Plugins/Newtonsoft.Json.dll</HintPath>
     </Reference>
     <Reference Include="UnityEngine.Analytics">
-      <HintPath>C:/Users/tanghai/AppData/Local/Unity/cache/packages/packages.unity.com/com.unity.analytics@2.0.13/UnityEngine.Analytics.dll</HintPath>
+      <HintPath>C:/Users/USER-PC/AppData/Local/Unity/cache/packages/packages.unity.com/com.unity.analytics@2.0.13/UnityEngine.Analytics.dll</HintPath>
     </Reference>
     <Reference Include="UnityEngine.Purchasing">
-      <HintPath>C:/Users/tanghai/AppData/Local/Unity/cache/packages/packages.unity.com/com.unity.purchasing@0.0.19/UnityEngine.Purchasing.dll</HintPath>
+      <HintPath>C:/Users/USER-PC/AppData/Local/Unity/cache/packages/packages.unity.com/com.unity.purchasing@0.0.19/UnityEngine.Purchasing.dll</HintPath>
     </Reference>
     <Reference Include="UnityEngine.StandardEvents">
-      <HintPath>C:/Users/tanghai/AppData/Local/Unity/cache/packages/packages.unity.com/com.unity.standardevents@1.0.10/UnityEngine.StandardEvents.dll</HintPath>
+      <HintPath>C:/Users/USER-PC/AppData/Local/Unity/cache/packages/packages.unity.com/com.unity.standardevents@1.0.10/UnityEngine.StandardEvents.dll</HintPath>
     </Reference>
   </ItemGroup>
   <ItemGroup>
@@ -349,6 +352,7 @@
     <Compile Include="Assets\Scripts\Entity\Scene.cs" />
     <Compile Include="Assets\Scripts\Entity\UnityWebRequestAsync.cs" />
     <Compile Include="Assets\Scripts\Entity\WWWAsync.cs" />
+    <Compile Include="Assets\Scripts\G2C_TestHandler.cs" />
     <Compile Include="Assets\Scripts\Helper\ActionHelper.cs" />
     <Compile Include="Assets\Scripts\Helper\BundleHelper.cs" />
     <Compile Include="Assets\Scripts\Helper\DllHelper.cs" />
@@ -932,4 +936,4 @@
   </ItemGroup>
   <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
   <Target Name="GenerateTargetFrameworkMonikerAttribute" />
-</Project>
+</Project>