Ver código fonte

把客户端逻辑跟数据分离

tanghai 5 anos atrás
pai
commit
504b8ef87d
34 arquivos alterados com 601 adições e 837 exclusões
  1. 15 0
      Server/Hotfix/Scene/SceneHelper.cs
  2. 2 17
      Unity/Assets/Hotfix/Move/M2C_PathfindingResultHandler.cs
  3. 9 21
      Unity/Assets/Hotfix/Scene/LoginHelper.cs
  4. 2 3
      Unity/Assets/Hotfix/Scene/MapHelper.cs
  5. 10 0
      Unity/Assets/Hotfix/Session/SessionComponentSystem.cs
  6. 0 13
      Unity/Assets/Hotfix/Unit/PlayerFactory.cs
  7. 103 0
      Unity/Assets/Hotfix/Unit/TurnComponentSystem.cs
  8. 60 0
      Unity/Assets/Hotfix/Unit/UnitComponent.cs
  9. 0 2
      Unity/Assets/Hotfix/Unit/UnitFactory.cs
  10. 8 0
      Unity/Assets/HotfixView/Opera.meta
  11. 58 0
      Unity/Assets/HotfixView/Opera/OperaComponentSystem.cs
  12. 11 0
      Unity/Assets/HotfixView/Opera/OperaComponentSystem.cs.meta
  13. 55 0
      Unity/Assets/HotfixView/Scene/SceneChangeComponentSystem.cs
  14. 0 1
      Unity/Assets/HotfixView/Scene/SceneFactory.cs
  15. 20 0
      Unity/Assets/HotfixView/Scene/SceneHelper.cs
  16. 11 0
      Unity/Assets/HotfixView/Scene/SceneHelper.cs.meta
  17. 1 1
      Unity/Assets/HotfixView/UI/UILobby/UILobbyComponentSystem.cs
  18. 1 1
      Unity/Assets/HotfixView/UI/UILogin/UILoginComponentSystem.cs
  19. 216 0
      Unity/Assets/HotfixView/Unit/AnimatorComponentSystem.cs
  20. 2 1
      Unity/Assets/HotfixView/Unity.HotfixView.asmdef
  21. 0 13
      Unity/Assets/Model/Base/Entity/Scene.cs
  22. 0 84
      Unity/Assets/Model/Move/MoveComponent.cs
  23. 0 58
      Unity/Assets/Model/Move/UnitPathComponent.cs
  24. 0 29
      Unity/Assets/Model/Session/SessionComponent.cs
  25. 0 17
      Unity/Assets/Model/Unit/Player.cs
  26. 0 88
      Unity/Assets/Model/Unit/PlayerComponent.cs
  27. 0 95
      Unity/Assets/Model/Unit/TurnComponent.cs
  28. 1 74
      Unity/Assets/Model/Unit/UnitComponent.cs
  29. 1 51
      Unity/Assets/ModelView/Opera/OperaComponent.cs
  30. 0 50
      Unity/Assets/ModelView/Scene/SceneChangeComponent.cs
  31. 1 213
      Unity/Assets/ModelView/Unit/AnimatorComponent.cs
  32. 3 1
      Unity/Unity.Hotfix.csproj
  33. 8 0
      Unity/Unity.HotfixView.csproj
  34. 3 4
      Unity/Unity.Model.csproj

+ 15 - 0
Server/Hotfix/Scene/SceneHelper.cs

@@ -0,0 +1,15 @@
+namespace ET
+{
+    public static class SceneHelper
+    {
+        public static int DomainZone(this Entity entity)
+        {
+            return ((Scene) entity.Domain).Zone;
+        }
+        
+        public static Scene DomainScene(this Entity entity)
+        {
+            return (Scene) entity.Domain;
+        }
+    }
+}

+ 2 - 17
Unity/Assets/Hotfix/Move/M2C_PathfindingResultHandler.cs

@@ -1,28 +1,13 @@
-
-using UnityEngine;
-
-namespace ET
+namespace ET
 {
 	[MessageHandler]
 	public class M2C_PathfindingResultHandler : AMHandler<M2C_PathfindingResult>
 	{
 		protected override async ETTask Run(Session session, M2C_PathfindingResult message)
 		{
-			Unit unit = Game.Scene.GetComponent<UnitComponent>().Get(message.Id);
+			Unit unit = session.Domain.GetComponent<UnitComponent>().Get(message.Id);
 			
 			
-			//unit.GetComponent<AnimatorComponent>().SetFloatValue("Speed", 5f);
-			UnitPathComponent unitPathComponent = unit.GetComponent<UnitPathComponent>();
-
-			unitPathComponent.StartMove(message).Coroutine();
-
-			//GizmosDebug.Instance.Path.Clear();
-			//GizmosDebug.Instance.Path.Add(new Vector3(message.X, message.Y, message.Z));
-			//for (int i = 0; i < message.Xs.Count; ++i)
-			//{
-			//	GizmosDebug.Instance.Path.Add(new Vector3(message.Xs[i], message.Ys[i], message.Zs[i]));
-			//}
-
 			await ETTask.CompletedTask;
 		}
 	}

+ 9 - 21
Unity/Assets/Hotfix/Scene/LoginHelper.cs

@@ -5,39 +5,27 @@ namespace ET
 {
     public static class LoginHelper
     {
-        public static async ETVoid OnLoginAsync(Entity domain, string address, string account)
+        public static async ETVoid Login(Scene zoneScene, string address, string account)
         {
             try
             {
                 // 创建一个ETModel层的Session
-                Session session = Game.Scene.GetComponent<NetOuterComponent>().Create(address);
-				
-                // 创建一个ETHotfix层的Session, ETHotfix的Session会通过ETModel层的Session发送消息
-                Session realmSession = EntityFactory.Create<Session, Session>(domain, session);
-                R2C_Login r2CLogin = (R2C_Login) await realmSession.Call(new C2R_Login() { Account = account, Password = "111111" });
-                realmSession.Dispose();
+                R2C_Login r2CLogin;
+                using (Session session = zoneScene.GetComponent<NetOuterComponent>().Create(address))
+                {
+                    r2CLogin = (R2C_Login) await session.Call(new C2R_Login() { Account = account, Password = "111111" });
+                }
 
-                // 创建一个ETModel层的Session,并且保存到ETModel.SessionComponent中
+                // 创建一个gate Session,并且保存到SessionComponent中
                 Session gateSession = Game.Scene.GetComponent<NetOuterComponent>().Create(r2CLogin.Address);
-                Game.Scene.AddComponent<SessionComponent>().Session = gateSession;
-				
-                // 创建一个ETHotfix层的Session, 并且保存到ETHotfix.SessionComponent中
-                Game.Scene.AddComponent<SessionComponent>().Session = EntityFactory.Create<Session, Session>(Game.Scene, gateSession);
+                zoneScene.AddComponent<SessionComponent>().Session = gateSession;
 				
-                G2C_LoginGate g2CLoginGate = (G2C_LoginGate)await SessionComponent.Instance.Session.Call(
+                G2C_LoginGate g2CLoginGate = (G2C_LoginGate)await gateSession.Call(
                     new C2G_LoginGate() { Key = r2CLogin.Key, GateId = r2CLogin.GateId});
 
                 Log.Info("登陆gate成功!");
 
-                // 创建Player
-                Player player = EntityFactory.CreateWithId<Player>(Game.Scene, g2CLoginGate.PlayerId);
-                PlayerComponent playerComponent = Game.Scene.GetComponent<PlayerComponent>();
-                playerComponent.MyPlayer = player;
-
                 await Game.EventSystem.Publish(new EventType.LoginFinish());
-
-                // 测试消息有成员是class类型
-                G2C_PlayerInfo g2CPlayerInfo = (G2C_PlayerInfo) await SessionComponent.Instance.Session.Call(new C2G_PlayerInfo());
             }
             catch (Exception e)
             {

+ 2 - 3
Unity/Assets/Hotfix/Scene/MapHelper.cs

@@ -5,7 +5,7 @@ namespace ET
 {
     public static class MapHelper
     {
-        public static async ETVoid EnterMapAsync(string sceneName)
+        public static async ETVoid EnterMapAsync(Scene zoneScene, string sceneName)
         {
             try
             {
@@ -22,8 +22,7 @@ namespace ET
                     await sceneChangeComponent.ChangeSceneAsync(sceneName);
                 }
 				*/
-                G2C_EnterMap g2CEnterMap = await SessionComponent.Instance.Session.Call(new C2G_EnterMap()) as G2C_EnterMap;
-                PlayerComponent.Instance.MyPlayer.UnitId = g2CEnterMap.UnitId;
+                G2C_EnterMap g2CEnterMap = await zoneScene.GetComponent<SessionComponent>().Session.Call(new C2G_EnterMap()) as G2C_EnterMap;
 				
                 //Game.Scene.AddComponent<OperaComponent>();
 				

+ 10 - 0
Unity/Assets/Hotfix/Session/SessionComponentSystem.cs

@@ -0,0 +1,10 @@
+namespace ET
+{
+	public class SessionComponentDestroySystem: DestroySystem<SessionComponent>
+	{
+		public override void Destroy(SessionComponent self)
+		{
+			self.Session.Dispose();
+		}
+	}
+}

+ 0 - 13
Unity/Assets/Hotfix/Unit/PlayerFactory.cs

@@ -1,13 +0,0 @@
-namespace ET
-{
-    public static class PlayerFactory
-    {
-        public static Player Create(Entity domain, long id)
-        {
-            Player player = EntityFactory.CreateWithId<Player>(domain, id);
-            PlayerComponent playerComponent = Game.Scene.GetComponent<PlayerComponent>();
-            playerComponent.Add(player);
-            return player;
-        }
-    }
-}

+ 103 - 0
Unity/Assets/Hotfix/Unit/TurnComponentSystem.cs

@@ -0,0 +1,103 @@
+using UnityEngine;
+
+namespace ET
+{
+	public class TurnComponentUpdateSystem : UpdateSystem<TurnComponent>
+	{
+		public override void Update(TurnComponent self)
+		{
+			self.Update();
+		}
+	}
+	
+    public static class TurnComponentSystem
+    {
+        
+		public static void Update(this TurnComponent self)
+		{
+			self.UpdateTurn();
+		}
+
+		private static void UpdateTurn(this TurnComponent self)
+		{
+			//Log.Debug($"update turn: {this.t} {this.TurnTime}");
+			if (self.t > self.TurnTime)
+			{
+				return;
+			}
+
+			self.t += Time.deltaTime;
+
+			Quaternion v = Quaternion.Slerp(self.From, self.To, self.t / self.TurnTime);
+			self.GetParent<Unit>().Rotation = v;
+		}
+
+		/// <summary>
+		/// 改变Unit的朝向
+		/// </summary>
+		public static void Turn2D(this TurnComponent self, Vector3 dir, float turnTime = 0.1f)
+		{
+			Vector3 nexpos = self.GetParent<Unit>().GameObject.transform.position + dir;
+			self.Turn(nexpos, turnTime);
+		}
+
+		/// <summary>
+		/// 改变Unit的朝向
+		/// </summary>
+		public static void Turn(this TurnComponent self, Vector3 target, float turnTime = 0.1f)
+		{
+			Quaternion quaternion = PositionHelper.GetVector3ToQuaternion(self.GetParent<Unit>().Position, target);
+
+			self.To = quaternion;
+			self.From = self.GetParent<Unit>().Rotation;
+			self.t = 0;
+			self.TurnTime = turnTime;
+		}
+
+		/// <summary>
+		/// 改变Unit的朝向
+		/// </summary>
+		/// <param name="angle">与X轴正方向的夹角</param>
+		public static void Turn(this TurnComponent self, float angle, float turnTime = 0.1f)
+		{
+			Quaternion quaternion = PositionHelper.GetAngleToQuaternion(angle);
+
+			self.To = quaternion;
+			self.From = self.GetParent<Unit>().Rotation;
+			self.t = 0;
+			self.TurnTime = turnTime;
+		}
+
+		public static void Turn(this TurnComponent self, Quaternion quaternion, float turnTime = 0.1f)
+		{
+			self.To = quaternion;
+			self.From = self.GetParent<Unit>().Rotation;
+			self.t = 0;
+			self.TurnTime = turnTime;
+		}
+
+		public static void TurnImmediately(this TurnComponent self, Quaternion quaternion)
+		{
+			self.GetParent<Unit>().Rotation = quaternion;
+		}
+
+		public static void TurnImmediately(this TurnComponent self, Vector3 target)
+		{
+			Vector3 nowPos = self.GetParent<Unit>().Position;
+			if (nowPos == target)
+			{
+				return;
+			}
+
+			Quaternion quaternion = PositionHelper.GetVector3ToQuaternion(self.GetParent<Unit>().Position, target);
+			self.GetParent<Unit>().Rotation = quaternion;
+		}
+
+		public static void TurnImmediately(this TurnComponent self, float angle)
+		{
+			Quaternion quaternion = PositionHelper.GetAngleToQuaternion(angle);
+			self.GetParent<Unit>().Rotation = quaternion;
+		}
+
+    }
+}

+ 60 - 0
Unity/Assets/Hotfix/Unit/UnitComponent.cs

@@ -0,0 +1,60 @@
+using System.Collections.Generic;
+using System.Linq;
+
+namespace ET
+{
+	
+	public class UnitComponentAwakeSystem : AwakeSystem<UnitComponent>
+	{
+		public override void Awake(UnitComponent self)
+		{
+		}
+	}
+	
+	public class UnitComponentDestroySystem : DestroySystem<UnitComponent>
+	{
+		public override void Destroy(UnitComponent self)
+		{
+			foreach (Unit unit in self.idUnits.Values)
+			{
+				unit.Dispose();
+			}
+
+			self.idUnits.Clear();
+		}
+	}
+	
+	public static class UnitComponentSystem
+	{
+		public static void Add(this UnitComponent self, Unit unit)
+		{
+			self.idUnits.Add(unit.Id, unit);
+			unit.Parent = self;
+		}
+
+		public static Unit Get(this UnitComponent self, long id)
+		{
+			Unit unit;
+			self.idUnits.TryGetValue(id, out unit);
+			return unit;
+		}
+
+		public static void Remove(this UnitComponent self, long id)
+		{
+			Unit unit;
+			self.idUnits.TryGetValue(id, out unit);
+			self.idUnits.Remove(id);
+			unit?.Dispose();
+		}
+
+		public static void RemoveNoDispose(this UnitComponent self, long id)
+		{
+			self.idUnits.Remove(id);
+		}
+
+		public static Unit[] GetAll(this UnitComponent self)
+		{
+			return self.idUnits.Values.ToArray();
+		}
+	}
+}

+ 0 - 2
Unity/Assets/Hotfix/Unit/UnitFactory.cs

@@ -8,9 +8,7 @@ namespace ET
         {
 	        Unit unit = EntityFactory.CreateWithId<Unit>(domain, id);
 	        
-			unit.AddComponent<MoveComponent>();
 	        unit.AddComponent<TurnComponent>();
-	        unit.AddComponent<UnitPathComponent>();
 
 	        Game.EventSystem.Publish(new EventType.AfterUnitCreate() {Unit = unit});
 	        

+ 8 - 0
Unity/Assets/HotfixView/Opera.meta

@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: b8d0722785e3e441a9da2a2d4a86fcbb
+folderAsset: yes
+DefaultImporter:
+  externalObjects: {}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 58 - 0
Unity/Assets/HotfixView/Opera/OperaComponentSystem.cs

@@ -0,0 +1,58 @@
+using System;
+using UnityEngine;
+
+namespace ET
+{
+    public class OperaComponentAwakeSystem : AwakeSystem<OperaComponent>
+    {
+        public override void Awake(OperaComponent self)
+        {
+            self.Awake();
+        }
+    }
+
+    public class OperaComponentUpdateSystem : UpdateSystem<OperaComponent>
+    {
+        public override void Update(OperaComponent self)
+        {
+            self.Update();
+        }
+    }
+    
+    public static class OperaComponentSystem
+    {
+        public static void Update(this OperaComponent self)
+        {
+            if (Input.GetMouseButtonDown(1))
+            {
+                Ray ray = Camera.main.ScreenPointToRay(Input.mousePosition);
+                RaycastHit hit;
+                if (Physics.Raycast(ray, out hit, 1000, self.mapMask))
+                {
+                    self.ClickPoint = hit.point;
+                    self.frameClickMap.X = self.ClickPoint.x;
+                    self.frameClickMap.Y = self.ClickPoint.y;
+                    self.frameClickMap.Z = self.ClickPoint.z;
+                    self.ZoneScene().GetComponent<SessionComponent>().Session.Send(self.frameClickMap);
+
+                    // 测试actor rpc消息
+                    self.TestActor().Coroutine();
+                }
+            }
+        }
+
+        public static async ETVoid TestActor(this OperaComponent self)
+        {
+            try
+            {
+                M2C_TestActorResponse response = (M2C_TestActorResponse)await self.ZoneScene().GetComponent<SessionComponent>().Session.Call(
+                    new C2M_TestActorRequest() { Info = "actor rpc request" });
+                Log.Info(response.Info);
+            }
+            catch (Exception e)
+            {
+                Log.Error(e);
+            }
+        }
+    }
+}

+ 11 - 0
Unity/Assets/HotfixView/Opera/OperaComponentSystem.cs.meta

@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: c2a6cc2a333d640d8a4c0c9a9edf3c71
+MonoImporter:
+  externalObjects: {}
+  serializedVersion: 2
+  defaultReferences: []
+  executionOrder: 0
+  icon: {instanceID: 0}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 55 - 0
Unity/Assets/HotfixView/Scene/SceneChangeComponentSystem.cs

@@ -0,0 +1,55 @@
+using UnityEngine.SceneManagement;
+
+namespace ET
+{
+    public class SceneChangeComponentUpdateSystem: UpdateSystem<SceneChangeComponent>
+    {
+        public override void Update(SceneChangeComponent self)
+        {
+            if (!self.loadMapOperation.isDone)
+            {
+                return;
+            }
+
+            if (self.tcs == null)
+            {
+                return;
+            }
+            
+            ETTaskCompletionSource tcs = self.tcs;
+            self.tcs = null;
+            tcs.SetResult();
+        }
+    }
+	
+    
+    public class SceneChangeComponentDestroySystem: DestroySystem<SceneChangeComponent>
+    {
+        public override void Destroy(SceneChangeComponent self)
+        {
+            self.loadMapOperation = null;
+            self.tcs = null;
+        }
+    }
+
+    public static class SceneChangeComponentSystem
+    {
+        public static async ETTask ChangeSceneAsync(this SceneChangeComponent self, string sceneName)
+        {
+            self.tcs = new ETTaskCompletionSource();
+            // 加载map
+            self.loadMapOperation = SceneManager.LoadSceneAsync(sceneName);
+            //this.loadMapOperation.allowSceneActivation = false;
+            await self.tcs.Task;
+        }
+        
+        public static int Process(this SceneChangeComponent self)
+        {
+            if (self.loadMapOperation == null)
+            {
+                return 0;
+            }
+            return (int)(self.loadMapOperation.progress * 100);
+        }
+    }
+}

+ 0 - 1
Unity/Assets/HotfixView/Scene/SceneFactory.cs

@@ -7,7 +7,6 @@ namespace ET
             Scene zoneScene = EntitySceneFactory.CreateScene(id, zone, SceneType.Zone, name, Game.Scene);
             
             zoneScene.AddComponent<NetOuterComponent>();
-            zoneScene.AddComponent<PlayerComponent>();
             zoneScene.AddComponent<UnitComponent>();
             
             // UI层的初始化

+ 20 - 0
Unity/Assets/HotfixView/Scene/SceneHelper.cs

@@ -0,0 +1,20 @@
+namespace ET
+{
+    public static class SceneHelper
+    {
+        public static int DomainZone(this Entity entity)
+        {
+            return ((Scene) entity.Domain).Zone;
+        }
+        
+        public static Scene DomainScene(this Entity entity)
+        {
+            return (Scene) entity.Domain;
+        }
+
+        public static Scene ZoneScene(this Entity entity)
+        {
+            return Game.Scene.Get(entity.DomainZone());
+        }
+    }
+}

+ 11 - 0
Unity/Assets/HotfixView/Scene/SceneHelper.cs.meta

@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 6fb064924cd4a4931b7173149810fee1
+MonoImporter:
+  externalObjects: {}
+  serializedVersion: 2
+  defaultReferences: []
+  executionOrder: 0
+  icon: {instanceID: 0}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 1 - 1
Unity/Assets/HotfixView/UI/UILobby/UILobbyComponentSystem.cs

@@ -19,7 +19,7 @@ namespace ET
     {
         public static void EnterMap(this UILobbyComponent self)
         {
-            MapHelper.EnterMapAsync("Map").Coroutine();
+            MapHelper.EnterMapAsync(self.ZoneScene(), "Map").Coroutine();
         }
     }
 }

+ 1 - 1
Unity/Assets/HotfixView/UI/UILogin/UILoginComponentSystem.cs

@@ -21,7 +21,7 @@ namespace ET
 	{
 		public static void OnLogin(this UILoginComponent self)
 		{
-			LoginHelper.OnLoginAsync(self.Domain, "127.0.0.1:10002", self.account.GetComponent<InputField>().text).Coroutine();
+			LoginHelper.Login(self.DomainScene(), "127.0.0.1:10002", self.account.GetComponent<InputField>().text).Coroutine();
 		}
 	}
 }

+ 216 - 0
Unity/Assets/HotfixView/Unit/AnimatorComponentSystem.cs

@@ -0,0 +1,216 @@
+using System;
+using UnityEngine;
+
+namespace ET
+{
+	public class AnimatorComponentAwakeSystem : AwakeSystem<AnimatorComponent>
+	{
+		public override void Awake(AnimatorComponent self)
+		{
+			self.Awake();
+		}
+	}
+
+	public class AnimatorComponentUpdateSystem : UpdateSystem<AnimatorComponent>
+	{
+		public override void Update(AnimatorComponent self)
+		{
+			self.Update();
+		}
+	}
+	
+	public class AnimatorComponentDestroySystem : DestroySystem<AnimatorComponent>
+	{
+		public override void Destroy(AnimatorComponent self)
+		{
+			self.animationClips = null;
+			self.Parameter = null;
+			self.Animator = null;
+		}
+	}
+
+	public static class AnimatorComponentSystem
+	{
+		public static void Awake(this AnimatorComponent self)
+		{
+			Animator animator = self.GetParent<Unit>().GameObject.GetComponent<Animator>();
+
+			if (animator == null)
+			{
+				return;
+			}
+
+			if (animator.runtimeAnimatorController == null)
+			{
+				return;
+			}
+
+			if (animator.runtimeAnimatorController.animationClips == null)
+			{
+				return;
+			}
+			self.Animator = animator;
+			foreach (AnimationClip animationClip in animator.runtimeAnimatorController.animationClips)
+			{
+				self.animationClips[animationClip.name] = animationClip;
+			}
+			foreach (AnimatorControllerParameter animatorControllerParameter in animator.parameters)
+			{
+				self.Parameter.Add(animatorControllerParameter.name);
+			}
+		}
+
+		public static void Update(this AnimatorComponent self)
+		{
+			if (self.isStop)
+			{
+				return;
+			}
+
+			if (self.MotionType == MotionType.None)
+			{
+				return;
+			}
+
+			try
+			{
+				self.Animator.SetFloat("MotionSpeed", self.MontionSpeed);
+
+				self.Animator.SetTrigger(self.MotionType.ToString());
+
+				self.MontionSpeed = 1;
+				self.MotionType = MotionType.None;
+			}
+			catch (Exception ex)
+			{
+				throw new Exception($"动作播放失败: {self.MotionType}", ex);
+			}
+		}
+
+		public static bool HasParameter(this AnimatorComponent self, string parameter)
+		{
+			return self.Parameter.Contains(parameter);
+		}
+
+		public static void PlayInTime(this AnimatorComponent self, MotionType motionType, float time)
+		{
+			AnimationClip animationClip;
+			if (!self.animationClips.TryGetValue(motionType.ToString(), out animationClip))
+			{
+				throw new Exception($"找不到该动作: {motionType}");
+			}
+
+			float motionSpeed = animationClip.length / time;
+			if (motionSpeed < 0.01f || motionSpeed > 1000f)
+			{
+				Log.Error($"motionSpeed数值异常, {motionSpeed}, 此动作跳过");
+				return;
+			}
+			self.MotionType = motionType;
+			self.MontionSpeed = motionSpeed;
+		}
+
+		public static void Play(this AnimatorComponent self, MotionType motionType, float motionSpeed = 1f)
+		{
+			if (!self.HasParameter(motionType.ToString()))
+			{
+				return;
+			}
+			self.MotionType = motionType;
+			self.MontionSpeed = motionSpeed;
+		}
+
+		public static float AnimationTime(this AnimatorComponent self, MotionType motionType)
+		{
+			AnimationClip animationClip;
+			if (!self.animationClips.TryGetValue(motionType.ToString(), out animationClip))
+			{
+				throw new Exception($"找不到该动作: {motionType}");
+			}
+			return animationClip.length;
+		}
+
+		public static void PauseAnimator(this AnimatorComponent self)
+		{
+			if (self.isStop)
+			{
+				return;
+			}
+			self.isStop = true;
+
+			if (self.Animator == null)
+			{
+				return;
+			}
+			self.stopSpeed = self.Animator.speed;
+			self.Animator.speed = 0;
+		}
+
+		public static void RunAnimator(this AnimatorComponent self)
+		{
+			if (!self.isStop)
+			{
+				return;
+			}
+
+			self.isStop = false;
+
+			if (self.Animator == null)
+			{
+				return;
+			}
+			self.Animator.speed = self.stopSpeed;
+		}
+
+		public static void SetBoolValue(this AnimatorComponent self, string name, bool state)
+		{
+			if (!self.HasParameter(name))
+			{
+				return;
+			}
+
+			self.Animator.SetBool(name, state);
+		}
+
+		public static void SetFloatValue(this AnimatorComponent self, string name, float state)
+		{
+			if (!self.HasParameter(name))
+			{
+				return;
+			}
+
+			self.Animator.SetFloat(name, state);
+		}
+
+		public static void SetIntValue(this AnimatorComponent self, string name, int value)
+		{
+			if (!self.HasParameter(name))
+			{
+				return;
+			}
+
+			self.Animator.SetInteger(name, value);
+		}
+
+		public static void SetTrigger(this AnimatorComponent self, string name)
+		{
+			if (!self.HasParameter(name))
+			{
+				return;
+			}
+
+			self.Animator.SetTrigger(name);
+		}
+
+		public static void SetAnimatorSpeed(this AnimatorComponent self, float speed)
+		{
+			self.stopSpeed = self.Animator.speed;
+			self.Animator.speed = speed;
+		}
+
+		public static void ResetAnimatorSpeed(this AnimatorComponent self)
+		{
+			self.Animator.speed = self.stopSpeed;
+		}
+	}
+}

+ 2 - 1
Unity/Assets/HotfixView/Unity.HotfixView.asmdef

@@ -3,7 +3,8 @@
     "references": [
         "GUID:703e1d0810996ed4b9064f1041de8bdc",
         "GUID:997f003cfffd9ec4fae70c0ac9b0ec2b",
-        "GUID:f7aec9df9b7212e448c697d7ebf558a3"
+        "GUID:f7aec9df9b7212e448c697d7ebf558a3",
+        "GUID:bebd02018e98e44409a761968a7cbcd9"
     ],
     "includePlatforms": [],
     "excludePlatforms": [],

+ 0 - 13
Unity/Assets/Model/Base/Entity/Scene.cs

@@ -54,17 +54,4 @@
             }
         }
     }
-    
-    public static class SceneEx
-    {
-        public static int DomainZone(this Entity entity)
-        {
-            return ((Scene) entity.Domain).Zone;
-        }
-        
-        public static Scene DomainScene(this Entity entity)
-        {
-            return (Scene) entity.Domain;
-        }
-    }
 }

+ 0 - 84
Unity/Assets/Model/Move/MoveComponent.cs

@@ -1,84 +0,0 @@
-using System;
-using System.Threading;
-using UnityEngine;
-
-namespace ET
-{
-	public class MoveComponentUpdateSystem : UpdateSystem<MoveComponent>
-	{
-		public override void Update(MoveComponent self)
-		{
-			self.Update();
-		}
-	}
-
-	public class MoveComponent : Entity
-	{
-		public Vector3 Target;
-
-		// 开启移动协程的时间
-		public long StartTime;
-
-		// 开启移动协程的Unit的位置
-		public Vector3 StartPos;
-
-		public long needTime;
-		
-		public ETTaskCompletionSource moveTcs;
-
-
-		public void Update()
-		{
-			if (this.moveTcs == null)
-			{
-				return;
-			}
-			
-			Unit unit = this.GetParent<Unit>();
-			long timeNow = TimeHelper.Now();
-
-			if (timeNow - this.StartTime >= this.needTime)
-			{
-				unit.Position = this.Target;
-				ETTaskCompletionSource tcs = this.moveTcs;
-				this.moveTcs = null;
-				tcs.SetResult();
-				return;
-			}
-
-			float amount = (timeNow - this.StartTime) * 1f / this.needTime;
-			unit.Position = Vector3.Lerp(this.StartPos, this.Target, amount);
-		}
-
-		public async ETTask MoveToAsync(Vector3 target, float speedValue, CancellationToken cancellationToken)
-		{
-			Unit unit = this.GetParent<Unit>();
-			
-			if ((target - this.Target).magnitude < 0.1f)
-			{
-				return;
-			}
-			
-			this.Target = target;
-
-			
-			this.StartPos = unit.Position;
-			this.StartTime = TimeHelper.Now();
-			float distance = (this.Target - this.StartPos).magnitude;
-			if (Math.Abs(distance) < 0.1f)
-			{
-				return;
-			}
-            
-			this.needTime = (long)(distance / speedValue * 1000);
-			
-			this.moveTcs = new ETTaskCompletionSource();
-			
-			cancellationToken.Register(() =>
-			{
-				this.moveTcs = null;
-			});
-			await this.moveTcs.Task;
-		}
-	}
-}

+ 0 - 58
Unity/Assets/Model/Move/UnitPathComponent.cs

@@ -1,58 +0,0 @@
-using System.Collections.Generic;
-using System.Threading;
-using UnityEngine;
-
-namespace ET
-{
-	public class UnitPathComponent : Entity
-	{
-		public List<Vector3> Path = new List<Vector3>();
-
-		public Vector3 ServerPos;
-
-		public CancellationTokenSource CancellationTokenSource;
-		
-		public async ETTask StartMove(CancellationToken cancellationToken)
-		{
-			for (int i = 0; i < this.Path.Count; ++i)
-			{
-				Vector3 v = this.Path[i];
-
-				float speed = 5;
-
-				if (i == 0)
-				{
-					// 矫正移动速度
-					Vector3 clientPos = this.GetParent<Unit>().Position;
-					float serverf = (ServerPos - v).magnitude;
-					if (serverf > 0.1f)
-					{
-						float clientf = (clientPos - v).magnitude;
-						speed = clientf / serverf * speed;
-					}
-				}
-
-				this.Parent.GetComponent<TurnComponent>().Turn(v);
-				await this.Parent.GetComponent<MoveComponent>().MoveToAsync(v, speed, cancellationToken);
-			}
-		}
-
-		public async ETVoid StartMove(M2C_PathfindingResult message)
-		{
-			// 取消之前的移动协程
-			this.CancellationTokenSource?.Cancel();
-			this.CancellationTokenSource = new CancellationTokenSource();
-
-			this.Path.Clear();
-			for (int i = 0; i < message.Xs.Count; ++i)
-			{
-				this.Path.Add(new Vector3(message.Xs[i], message.Ys[i], message.Zs[i]));
-			}
-			ServerPos = new Vector3(message.X, message.Y, message.Z);
-			
-			await StartMove(this.CancellationTokenSource.Token);
-			this.CancellationTokenSource.Dispose();
-			this.CancellationTokenSource = null;
-		}
-	}
-}

+ 0 - 29
Unity/Assets/Model/Session/SessionComponent.cs

@@ -1,36 +1,7 @@
 namespace ET
 {
-	public class SessionComponentAwakeSystem : AwakeSystem<SessionComponent>
-	{
-		public override void Awake(SessionComponent self)
-		{
-			self.Awake();
-		}
-	}
-
 	public class SessionComponent: Entity
 	{
-		public static SessionComponent Instance;
-
 		public Session Session;
-
-		public void Awake()
-		{
-			Instance = this;
-		}
-
-		public override void Dispose()
-		{
-			if (this.IsDisposed)
-			{
-				return;
-			}
-
-			base.Dispose();
-
-			this.Session.Dispose();
-			this.Session = null;
-			Instance = null;
-		}
 	}
 }

+ 0 - 17
Unity/Assets/Model/Unit/Player.cs

@@ -1,17 +0,0 @@
-namespace ET
-{
-	public sealed class Player : Entity
-	{
-		public long UnitId { get; set; }
-		
-		public override void Dispose()
-		{
-			if (this.IsDisposed)
-			{
-				return;
-			}
-
-			base.Dispose();
-		}
-	}
-}

+ 0 - 88
Unity/Assets/Model/Unit/PlayerComponent.cs

@@ -1,88 +0,0 @@
-using System.Collections.Generic;
-using System.Linq;
-
-namespace ET
-{
-	public class PlayerComponentAwakeSystem : AwakeSystem<PlayerComponent>
-	{
-		public override void Awake(PlayerComponent self)
-		{
-			self.Awake();
-		}
-	}
-	
-	public class PlayerComponent : Entity
-	{
-		public static PlayerComponent Instance { get; private set; }
-
-		private Player myPlayer;
-
-		public Player MyPlayer
-		{
-			get
-			{
-				return this.myPlayer;
-			}
-			set
-			{
-				this.myPlayer = value;
-				this.myPlayer.Parent = this;
-			}
-		}
-		
-		private readonly Dictionary<long, Player> idPlayers = new Dictionary<long, Player>();
-
-		public void Awake()
-		{
-			Instance = this;
-		}
-		
-		public void Add(Player player)
-		{
-			this.idPlayers.Add(player.Id, player);
-			player.Parent = this;
-		}
-
-		public Player Get(long id)
-		{
-			Player player;
-			this.idPlayers.TryGetValue(id, out player);
-			return player;
-		}
-
-		public void Remove(long id)
-		{
-			this.idPlayers.Remove(id);
-		}
-
-		public int Count
-		{
-			get
-			{
-				return this.idPlayers.Count;
-			}
-		}
-
-		public Player[] GetAll()
-		{
-			return this.idPlayers.Values.ToArray();
-		}
-
-		public override void Dispose()
-		{
-			if (this.IsDisposed)
-			{
-				return;
-			}
-			
-			base.Dispose();
-
-			foreach (Player player in this.idPlayers.Values)
-			{
-				player.Dispose();
-			}
-
-			Instance = null;
-		}
-	}
-}

+ 0 - 95
Unity/Assets/Model/Unit/TurnComponent.cs

@@ -2,15 +2,6 @@
 
 namespace ET
 {
-	
-	public class TurnComponentUpdateSystem : UpdateSystem<TurnComponent>
-	{
-		public override void Update(TurnComponent self)
-		{
-			self.Update();
-		}
-	}
-
 	public class TurnComponent : Entity
 	{
 		// turn
@@ -19,92 +10,6 @@ namespace ET
 		public float t = float.MaxValue;
 		public float TurnTime = 0.1f;
 
-		public void Update()
-		{
-			UpdateTurn();
-		}
-
-		private void UpdateTurn()
-		{
-			//Log.Debug($"update turn: {this.t} {this.TurnTime}");
-			if (this.t > this.TurnTime)
-			{
-				return;
-			}
-
-			this.t += Time.deltaTime;
-
-			Quaternion v = Quaternion.Slerp(this.From, this.To, this.t / this.TurnTime);
-			this.GetParent<Unit>().Rotation = v;
-		}
-
-		/// <summary>
-		/// 改变Unit的朝向
-		/// </summary>
-		public void Turn2D(Vector3 dir, float turnTime = 0.1f)
-		{
-			Vector3 nexpos = this.GetParent<Unit>().GameObject.transform.position + dir;
-			Turn(nexpos, turnTime);
-		}
-
-		/// <summary>
-		/// 改变Unit的朝向
-		/// </summary>
-		public void Turn(Vector3 target, float turnTime = 0.1f)
-		{
-			Quaternion quaternion = PositionHelper.GetVector3ToQuaternion(this.GetParent<Unit>().Position, target);
-
-			this.To = quaternion;
-			this.From = this.GetParent<Unit>().Rotation;
-			this.t = 0;
-			this.TurnTime = turnTime;
-		}
-
-		/// <summary>
-		/// 改变Unit的朝向
-		/// </summary>
-		/// <param name="angle">与X轴正方向的夹角</param>
-		public void Turn(float angle, float turnTime = 0.1f)
-		{
-			Quaternion quaternion = PositionHelper.GetAngleToQuaternion(angle);
-
-			this.To = quaternion;
-			this.From = this.GetParent<Unit>().Rotation;
-			this.t = 0;
-			this.TurnTime = turnTime;
-		}
-
-		public void Turn(Quaternion quaternion, float turnTime = 0.1f)
-		{
-			this.To = quaternion;
-			this.From = this.GetParent<Unit>().Rotation;
-			this.t = 0;
-			this.TurnTime = turnTime;
-		}
-
-		public void TurnImmediately(Quaternion quaternion)
-		{
-			this.GetParent<Unit>().Rotation = quaternion;
-		}
-
-		public void TurnImmediately(Vector3 target)
-		{
-			Vector3 nowPos = this.GetParent<Unit>().Position;
-			if (nowPos == target)
-			{
-				return;
-			}
-
-			Quaternion quaternion = PositionHelper.GetVector3ToQuaternion(this.GetParent<Unit>().Position, target);
-			this.GetParent<Unit>().Rotation = quaternion;
-		}
-
-		public void TurnImmediately(float angle)
-		{
-			Quaternion quaternion = PositionHelper.GetAngleToQuaternion(angle);
-			this.GetParent<Unit>().Rotation = quaternion;
-		}
-
 		public override void Dispose()
 		{
 			if (this.IsDisposed)

+ 1 - 74
Unity/Assets/Model/Unit/UnitComponent.cs

@@ -4,82 +4,9 @@ using System.Linq;
 namespace ET
 {
 	
-	public class UnitComponentSystem : AwakeSystem<UnitComponent>
-	{
-		public override void Awake(UnitComponent self)
-		{
-			self.Awake();
-		}
-	}
-	
 	public class UnitComponent: Entity
 	{
-		public static UnitComponent Instance { get; private set; }
-
+		public Dictionary<long, Unit> idUnits = new Dictionary<long, Unit>();
 		public Unit MyUnit;
-		
-		private readonly Dictionary<long, Unit> idUnits = new Dictionary<long, Unit>();
-
-		public void Awake()
-		{
-			Instance = this;
-		}
-
-		public override void Dispose()
-		{
-			if (this.IsDisposed)
-			{
-				return;
-			}
-			base.Dispose();
-
-			foreach (Unit unit in this.idUnits.Values)
-			{
-				unit.Dispose();
-			}
-
-			this.idUnits.Clear();
-
-			Instance = null;
-		}
-
-		public void Add(Unit unit)
-		{
-			this.idUnits.Add(unit.Id, unit);
-			unit.Parent = this;
-		}
-
-		public Unit Get(long id)
-		{
-			Unit unit;
-			this.idUnits.TryGetValue(id, out unit);
-			return unit;
-		}
-
-		public void Remove(long id)
-		{
-			Unit unit;
-			this.idUnits.TryGetValue(id, out unit);
-			this.idUnits.Remove(id);
-			unit?.Dispose();
-		}
-
-		public void RemoveNoDispose(long id)
-		{
-			this.idUnits.Remove(id);
-		}
-
-		public int Count
-		{
-			get
-			{
-				return this.idUnits.Count;
-			}
-		}
-
-		public Unit[] GetAll()
-		{
-			return this.idUnits.Values.ToArray();
-		}
 	}
 }

+ 1 - 51
Unity/Assets/ModelView/Opera/OperaComponent.cs

@@ -4,22 +4,6 @@ using UnityEngine;
 
 namespace ET
 {
-    public class OperaComponentAwakeSystem : AwakeSystem<OperaComponent>
-    {
-	    public override void Awake(OperaComponent self)
-	    {
-		    self.Awake();
-	    }
-    }
-
-	public class OperaComponentUpdateSystem : UpdateSystem<OperaComponent>
-	{
-		public override void Update(OperaComponent self)
-		{
-			self.Update();
-		}
-	}
-
 	public class OperaComponent: Entity
     {
         public Vector3 ClickPoint;
@@ -31,40 +15,6 @@ namespace ET
 		    this.mapMask = LayerMask.GetMask("Map");
 	    }
 
-	    private readonly Frame_ClickMap frameClickMap = new Frame_ClickMap();
-
-        public void Update()
-        {
-            if (Input.GetMouseButtonDown(1))
-            {
-                Ray ray = Camera.main.ScreenPointToRay(Input.mousePosition);
-                RaycastHit hit;
-	            if (Physics.Raycast(ray, out hit, 1000, this.mapMask))
-	            {
-					this.ClickPoint = hit.point;
-		            frameClickMap.X = this.ClickPoint.x;
-		            frameClickMap.Y = this.ClickPoint.y;
-		            frameClickMap.Z = this.ClickPoint.z;
-		            SessionComponent.Instance.Session.Send(frameClickMap);
-
-					// 测试actor rpc消息
-					this.TestActor().Coroutine();
-				}
-            }
-        }
-
-	    public async ETVoid TestActor()
-	    {
-		    try
-		    {
-			    M2C_TestActorResponse response = (M2C_TestActorResponse)await SessionComponent.Instance.Session.Call(
-						new C2M_TestActorRequest() { Info = "actor rpc request" });
-			    Log.Info(response.Info);
-			}
-		    catch (Exception e)
-		    {
-				Log.Error(e);
-		    }
-		}
+	    public readonly Frame_ClickMap frameClickMap = new Frame_ClickMap();
     }
 }

+ 0 - 50
Unity/Assets/ModelView/Scene/SceneChangeComponent.cs

@@ -1,60 +1,10 @@
 using UnityEngine;
-using UnityEngine.SceneManagement;
 
 namespace ET
 {
-    
-    public class SceneChangeComponentUpdateSystem: UpdateSystem<SceneChangeComponent>
-    {
-        public override void Update(SceneChangeComponent self)
-        {
-            if (self.loadMapOperation.isDone)
-            {
-                self.tcs.SetResult();
-            }
-           
-        }
-    }
-	
-    
-    public class SceneChangeComponentDestroySystem: DestroySystem<SceneChangeComponent>
-    {
-        public override void Destroy(SceneChangeComponent self)
-        {
-            self.loadMapOperation = null;
-            self.tcs = null;
-        }
-    }
-
     public class SceneChangeComponent: Entity
     {
         public AsyncOperation loadMapOperation;
         public ETTaskCompletionSource tcs;
-
-        public async ETTask ChangeSceneAsync(string sceneName)
-        {
-            this.tcs = new ETTaskCompletionSource();
-            // 加载map
-            this.loadMapOperation = SceneManager.LoadSceneAsync(sceneName);
-            //this.loadMapOperation.allowSceneActivation = false;
-            await this.tcs.Task;
-        }
-
-        public int Process
-        {
-            get
-            {
-                if (this.loadMapOperation == null)
-                {
-                    return 0;
-                }
-                return (int)(this.loadMapOperation.progress * 100);
-            }
-        }
-
-        public void Finish()
-        {
-            this.tcs.SetResult();
-        }
     }
 }

+ 1 - 213
Unity/Assets/ModelView/Unit/AnimatorComponent.cs

@@ -1,5 +1,4 @@
-using System;
-using System.Collections.Generic;
+using System.Collections.Generic;
 using UnityEngine;
 
 namespace ET
@@ -10,22 +9,6 @@ namespace ET
 		Idle,
 		Run,
 	}
-	
-	public class AnimatorComponentAwakeSystem : AwakeSystem<AnimatorComponent>
-	{
-		public override void Awake(AnimatorComponent self)
-		{
-			self.Awake();
-		}
-	}
-
-	public class AnimatorComponentUpdateSystem : UpdateSystem<AnimatorComponent>
-	{
-		public override void Update(AnimatorComponent self)
-		{
-			self.Update();
-		}
-	}
 
 	public class AnimatorComponent : Entity
 	{
@@ -37,200 +20,5 @@ namespace ET
 		public bool isStop;
 		public float stopSpeed;
 		public Animator Animator;
-
-		public void Awake()
-		{
-			Animator animator = this.GetParent<Unit>().GameObject.GetComponent<Animator>();
-
-			if (animator == null)
-			{
-				return;
-			}
-
-			if (animator.runtimeAnimatorController == null)
-			{
-				return;
-			}
-
-			if (animator.runtimeAnimatorController.animationClips == null)
-			{
-				return;
-			}
-			this.Animator = animator;
-			foreach (AnimationClip animationClip in animator.runtimeAnimatorController.animationClips)
-			{
-				this.animationClips[animationClip.name] = animationClip;
-			}
-			foreach (AnimatorControllerParameter animatorControllerParameter in animator.parameters)
-			{
-				this.Parameter.Add(animatorControllerParameter.name);
-			}
-		}
-
-		public void Update()
-		{
-			if (this.isStop)
-			{
-				return;
-			}
-
-			if (this.MotionType == MotionType.None)
-			{
-				return;
-			}
-
-			try
-			{
-				this.Animator.SetFloat("MotionSpeed", this.MontionSpeed);
-
-				this.Animator.SetTrigger(this.MotionType.ToString());
-
-				this.MontionSpeed = 1;
-				this.MotionType = MotionType.None;
-			}
-			catch (Exception ex)
-			{
-				throw new Exception($"动作播放失败: {this.MotionType}", ex);
-			}
-		}
-
-		public bool HasParameter(string parameter)
-		{
-			return this.Parameter.Contains(parameter);
-		}
-
-		public void PlayInTime(MotionType motionType, float time)
-		{
-			AnimationClip animationClip;
-			if (!this.animationClips.TryGetValue(motionType.ToString(), out animationClip))
-			{
-				throw new Exception($"找不到该动作: {motionType}");
-			}
-
-			float motionSpeed = animationClip.length / time;
-			if (motionSpeed < 0.01f || motionSpeed > 1000f)
-			{
-				Log.Error($"motionSpeed数值异常, {motionSpeed}, 此动作跳过");
-				return;
-			}
-			this.MotionType = motionType;
-			this.MontionSpeed = motionSpeed;
-		}
-
-		public void Play(MotionType motionType, float motionSpeed = 1f)
-		{
-			if (!this.HasParameter(motionType.ToString()))
-			{
-				return;
-			}
-			this.MotionType = motionType;
-			this.MontionSpeed = motionSpeed;
-		}
-
-		public float AnimationTime(MotionType motionType)
-		{
-			AnimationClip animationClip;
-			if (!this.animationClips.TryGetValue(motionType.ToString(), out animationClip))
-			{
-				throw new Exception($"找不到该动作: {motionType}");
-			}
-			return animationClip.length;
-		}
-
-		public void PauseAnimator()
-		{
-			if (this.isStop)
-			{
-				return;
-			}
-			this.isStop = true;
-
-			if (this.Animator == null)
-			{
-				return;
-			}
-			this.stopSpeed = this.Animator.speed;
-			this.Animator.speed = 0;
-		}
-
-		public void RunAnimator()
-		{
-			if (!this.isStop)
-			{
-				return;
-			}
-
-			this.isStop = false;
-
-			if (this.Animator == null)
-			{
-				return;
-			}
-			this.Animator.speed = this.stopSpeed;
-		}
-
-		public void SetBoolValue(string name, bool state)
-		{
-			if (!this.HasParameter(name))
-			{
-				return;
-			}
-
-			this.Animator.SetBool(name, state);
-		}
-
-		public void SetFloatValue(string name, float state)
-		{
-			if (!this.HasParameter(name))
-			{
-				return;
-			}
-
-			this.Animator.SetFloat(name, state);
-		}
-
-		public void SetIntValue(string name, int value)
-		{
-			if (!this.HasParameter(name))
-			{
-				return;
-			}
-
-			this.Animator.SetInteger(name, value);
-		}
-
-		public void SetTrigger(string name)
-		{
-			if (!this.HasParameter(name))
-			{
-				return;
-			}
-
-			this.Animator.SetTrigger(name);
-		}
-
-		public void SetAnimatorSpeed(float speed)
-		{
-			this.stopSpeed = this.Animator.speed;
-			this.Animator.speed = speed;
-		}
-
-		public void ResetAnimatorSpeed()
-		{
-			this.Animator.speed = this.stopSpeed;
-		}
-
-		public override void Dispose()
-		{
-			if (this.IsDisposed)
-			{
-				return;
-			}
-			base.Dispose();
-
-			this.animationClips = null;
-			this.Parameter = null;
-			this.Animator = null;
-		}
 	}
 }

+ 3 - 1
Unity/Unity.Hotfix.csproj

@@ -65,8 +65,10 @@
      <Compile Include="Assets\Hotfix\Move\M2C_PathfindingResultHandler.cs" />
      <Compile Include="Assets\Hotfix\Scene\LoginHelper.cs" />
      <Compile Include="Assets\Hotfix\Scene\MapHelper.cs" />
+     <Compile Include="Assets\Hotfix\Session\SessionComponentSystem.cs" />
      <Compile Include="Assets\Hotfix\Unit\M2C_CreateUnitsHandler.cs" />
-     <Compile Include="Assets\Hotfix\Unit\PlayerFactory.cs" />
+     <Compile Include="Assets\Hotfix\Unit\TurnComponentSystem.cs" />
+     <Compile Include="Assets\Hotfix\Unit\UnitComponent.cs" />
      <Compile Include="Assets\Hotfix\Unit\UnitFactory.cs" />
      <None Include="Assets\Hotfix\Unity.Hotfix.asmdef" />
  <Reference Include="UnityEditor.UI">

+ 8 - 0
Unity/Unity.HotfixView.csproj

@@ -62,8 +62,11 @@
      <Compile Include="Assets\HotfixView\Module\Resource\GameObjectHelper.cs" />
      <Compile Include="Assets\HotfixView\Module\UI\UIComponentSystem.cs" />
      <Compile Include="Assets\HotfixView\Module\UI\UIEventComponentSystem.cs" />
+     <Compile Include="Assets\HotfixView\Opera\OperaComponentSystem.cs" />
      <Compile Include="Assets\HotfixView\Scene\AfterCreateZoneScene_AddComponent.cs" />
+     <Compile Include="Assets\HotfixView\Scene\SceneChangeComponentSystem.cs" />
      <Compile Include="Assets\HotfixView\Scene\SceneFactory.cs" />
+     <Compile Include="Assets\HotfixView\Scene\SceneHelper.cs" />
      <Compile Include="Assets\HotfixView\UI\UIHelper.cs" />
      <Compile Include="Assets\HotfixView\UI\UILoading\LoadingBeginEvent_CreateLoadingUI.cs" />
      <Compile Include="Assets\HotfixView\UI\UILoading\LoadingFinishEvent_RemoveLoadingUI.cs" />
@@ -78,6 +81,7 @@
      <Compile Include="Assets\HotfixView\UI\UILogin\UILoginComponentSystem.cs" />
      <Compile Include="Assets\HotfixView\UI\UILogin\UILoginEvent.cs" />
      <Compile Include="Assets\HotfixView\Unit\AfterUnitCreate_CreateUnitView.cs" />
+     <Compile Include="Assets\HotfixView\Unit\AnimatorComponentSystem.cs" />
      <None Include="Assets\HotfixView\Unity.HotfixView.asmdef" />
  <Reference Include="UnityEditor.UI">
  <HintPath>/Users/tanghai/Documents/ET/Unity/Library/ScriptAssemblies/UnityEditor.UI.dll</HintPath>
@@ -675,6 +679,10 @@
       <Project>{2F8409C1-DA01-D464-DBF2-00C6449E459E}</Project>
       <Name>Unity.ModelView</Name>
     </ProjectReference>
+    <ProjectReference Include="Unity.ThirdParty.csproj">
+      <Project>{E15BADD2-3A26-309A-AB0F-DC5B08044350}</Project>
+      <Name>Unity.ThirdParty</Name>
+    </ProjectReference>
   </ItemGroup>
   <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
   <!-- To modify your build process, add your task inside one of the targets below and uncomment it. 

+ 3 - 4
Unity/Unity.Model.csproj

@@ -201,11 +201,7 @@
      <Compile Include="Assets\Model\Module\Resource\ResourcesComponent.cs" />
      <Compile Include="Assets\Model\Module\Resource\VersionConfig.cs" />
      <Compile Include="Assets\Model\Module\UnityWebRequest\UnityWebRequestAsync.cs" />
-     <Compile Include="Assets\Model\Move\MoveComponent.cs" />
-     <Compile Include="Assets\Model\Move\UnitPathComponent.cs" />
      <Compile Include="Assets\Model\Session\SessionComponent.cs" />
-     <Compile Include="Assets\Model\Unit\Player.cs" />
-     <Compile Include="Assets\Model\Unit\PlayerComponent.cs" />
      <Compile Include="Assets\Model\Unit\TurnComponent.cs" />
      <Compile Include="Assets\Model\Unit\Unit.cs" />
      <Compile Include="Assets\Model\Unit\UnitComponent.cs" />
@@ -799,6 +795,9 @@
       <Name>Unity.ThirdParty</Name>
     </ProjectReference>
   </ItemGroup>
+  <ItemGroup>
+    <Folder Include="Assets\Model\Move" />
+  </ItemGroup>
   <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
   <!-- To modify your build process, add your task inside one of the targets below and uncomment it. 
        Other similar extension points exist, see Microsoft.Common.targets.