Bladeren bron

删除部分UI代码,&征用部分Demo代码

大爷 2 jaren geleden
bovenliggende
commit
e87897cdc2
54 gewijzigde bestanden met toevoegingen van 236 en 558 verwijderingen
  1. 1 1
      Unity/Assets/Scripts/Codes/HotfixView/Client/Camera.meta
  2. 5 3
      Unity/Assets/Scripts/Codes/HotfixView/Client/Camera/CameraComponentSystem.cs
  3. 0 0
      Unity/Assets/Scripts/Codes/HotfixView/Client/Camera/CameraComponentSystem.cs.meta
  4. 0 24
      Unity/Assets/Scripts/Codes/HotfixView/Client/Demo/Unit/AfterUnitCreate_CreateUnitView.cs
  5. 0 11
      Unity/Assets/Scripts/Codes/HotfixView/Client/Demo/Unit/AfterUnitCreate_CreateUnitView.cs.meta
  6. 0 220
      Unity/Assets/Scripts/Codes/HotfixView/Client/Demo/Unit/AnimatorComponentSystem.cs
  7. 1 1
      Unity/Assets/Scripts/Codes/HotfixView/Client/Opera.meta
  8. 1 2
      Unity/Assets/Scripts/Codes/HotfixView/Client/Opera/OperaComponentSystem.cs
  9. 0 0
      Unity/Assets/Scripts/Codes/HotfixView/Client/Opera/OperaComponentSystem.cs.meta
  10. 0 8
      Unity/Assets/Scripts/Codes/HotfixView/Client/UI/UIHelp.meta
  11. 0 12
      Unity/Assets/Scripts/Codes/HotfixView/Client/UI/UIHelp/SceneChangeFinishEvent_CreateUIHelp.cs
  12. 0 11
      Unity/Assets/Scripts/Codes/HotfixView/Client/UI/UIHelp/SceneChangeFinishEvent_CreateUIHelp.cs.meta
  13. 0 32
      Unity/Assets/Scripts/Codes/HotfixView/Client/UI/UIHelp/UIHelpEvent.cs
  14. 0 11
      Unity/Assets/Scripts/Codes/HotfixView/Client/UI/UIHelp/UIHelpEvent.cs.meta
  15. 0 32
      Unity/Assets/Scripts/Codes/HotfixView/Client/UI/UILogin/UILoginComponentSystem.cs
  16. 0 11
      Unity/Assets/Scripts/Codes/HotfixView/Client/UI/UILogin/UILoginComponentSystem.cs.meta
  17. 0 24
      Unity/Assets/Scripts/Codes/HotfixView/Client/UI/UILogin/UILoginEvent.cs
  18. 0 11
      Unity/Assets/Scripts/Codes/HotfixView/Client/UI/UILogin/UILoginEvent.cs.meta
  19. 220 0
      Unity/Assets/Scripts/Codes/HotfixView/Client/Unit/AnimatorComponentSystem.cs
  20. 0 0
      Unity/Assets/Scripts/Codes/HotfixView/Client/Unit/AnimatorComponentSystem.cs.meta
  21. 1 1
      Unity/Assets/Scripts/Codes/HotfixView/Client/Unit/ChangePosition_SyncGameObjectPos.cs
  22. 0 0
      Unity/Assets/Scripts/Codes/HotfixView/Client/Unit/ChangePosition_SyncGameObjectPos.cs.meta
  23. 1 1
      Unity/Assets/Scripts/Codes/HotfixView/Client/Unit/ChangeRotation_SyncGameObjectRotation.cs
  24. 0 0
      Unity/Assets/Scripts/Codes/HotfixView/Client/Unit/ChangeRotation_SyncGameObjectRotation.cs.meta
  25. 2 4
      Unity/Assets/Scripts/Codes/HotfixView/Client/Unit/GameObjectComponentSystem.cs
  26. 0 0
      Unity/Assets/Scripts/Codes/HotfixView/Client/Unit/GameObjectComponentSystem.cs.meta
  27. 0 0
      Unity/Assets/Scripts/Codes/ModelView/Client/Camera.meta
  28. 3 2
      Unity/Assets/Scripts/Codes/ModelView/Client/Camera/CameraComponent.cs
  29. 0 0
      Unity/Assets/Scripts/Codes/ModelView/Client/Camera/CameraComponent.cs.meta
  30. 0 8
      Unity/Assets/Scripts/Codes/ModelView/Client/Demo/UI.meta
  31. 0 8
      Unity/Assets/Scripts/Codes/ModelView/Client/Demo/UI/UIHelp.meta
  32. 0 11
      Unity/Assets/Scripts/Codes/ModelView/Client/Demo/UI/UIHelp/UIHelpComponent.cs
  33. 0 11
      Unity/Assets/Scripts/Codes/ModelView/Client/Demo/UI/UIHelp/UIHelpComponent.cs.meta
  34. 0 11
      Unity/Assets/Scripts/Codes/ModelView/Client/Demo/UI/UILoading/UILoadingComponent.cs
  35. 0 11
      Unity/Assets/Scripts/Codes/ModelView/Client/Demo/UI/UILoading/UILoadingComponent.cs.meta
  36. 0 8
      Unity/Assets/Scripts/Codes/ModelView/Client/Demo/UI/UILobby.meta
  37. 0 13
      Unity/Assets/Scripts/Codes/ModelView/Client/Demo/UI/UILobby/UILobbyComponent.cs
  38. 0 11
      Unity/Assets/Scripts/Codes/ModelView/Client/Demo/UI/UILobby/UILobbyComponent.cs.meta
  39. 0 8
      Unity/Assets/Scripts/Codes/ModelView/Client/Demo/UI/UILogin.meta
  40. 0 12
      Unity/Assets/Scripts/Codes/ModelView/Client/Demo/UI/UILogin/UILoginComponent.cs
  41. 0 11
      Unity/Assets/Scripts/Codes/ModelView/Client/Demo/UI/UILogin/UILoginComponent.cs.meta
  42. 0 0
      Unity/Assets/Scripts/Codes/ModelView/Client/Global.meta
  43. 1 1
      Unity/Assets/Scripts/Codes/ModelView/Client/Global/GlobalComponent.cs
  44. 0 0
      Unity/Assets/Scripts/Codes/ModelView/Client/Global/GlobalComponent.cs.meta
  45. 0 0
      Unity/Assets/Scripts/Codes/ModelView/Client/Opera.meta
  46. 0 0
      Unity/Assets/Scripts/Codes/ModelView/Client/Opera/OperaComponent.cs
  47. 0 0
      Unity/Assets/Scripts/Codes/ModelView/Client/Opera/OperaComponent.cs.meta
  48. 0 1
      Unity/Assets/Scripts/Codes/ModelView/Client/Plugins/Example/ModelView.cs
  49. 0 11
      Unity/Assets/Scripts/Codes/ModelView/Client/Plugins/Example/ModelView.cs.meta
  50. 0 0
      Unity/Assets/Scripts/Codes/ModelView/Client/Unit.meta
  51. 0 0
      Unity/Assets/Scripts/Codes/ModelView/Client/Unit/AnimatorComponent.cs
  52. 0 0
      Unity/Assets/Scripts/Codes/ModelView/Client/Unit/AnimatorComponent.cs.meta
  53. 0 0
      Unity/Assets/Scripts/Codes/ModelView/Client/Unit/GameObjectComponent.cs
  54. 0 0
      Unity/Assets/Scripts/Codes/ModelView/Client/Unit/GameObjectComponent.cs.meta

+ 1 - 1
Unity/Assets/Scripts/Codes/HotfixView/Client/FGUI.meta → Unity/Assets/Scripts/Codes/HotfixView/Client/Camera.meta

@@ -1,5 +1,5 @@
 fileFormatVersion: 2
-guid: cb3e7f3049eb7e0458955f814a1a6473
+guid: 2a6db53ec6138384188e073f2be742c9
 folderAsset: yes
 DefaultImporter:
   externalObjects: {}

+ 5 - 3
Unity/Assets/Scripts/Codes/HotfixView/Client/Demo/Camera/CameraComponentSystem.cs → Unity/Assets/Scripts/Codes/HotfixView/Client/Camera/CameraComponentSystem.cs

@@ -30,14 +30,16 @@ namespace ET.Client
 
 		private static void LateUpdate(this CameraComponent self)
 		{
-			// 摄像机每帧更新位置
-			self.UpdatePosition();
+			if (self.Unit != null)
+			{
+				self.UpdatePosition();
+			}
 		}
 
 		private static void UpdatePosition(this CameraComponent self)
 		{
 			Vector3 cameraPos = self.mainCamera.transform.position;
-			self.mainCamera.transform.position = new Vector3(self.Unit.Position.x, cameraPos.y, self.Unit.Position.z - 1);
+			self.mainCamera.transform.position = new Vector3(self.Unit.Position.x, cameraPos.y, self.Unit.Position.z - 10);
 		}
 	}
 }

+ 0 - 0
Unity/Assets/Scripts/Codes/HotfixView/Client/Demo/Camera/CameraComponentSystem.cs.meta → Unity/Assets/Scripts/Codes/HotfixView/Client/Camera/CameraComponentSystem.cs.meta


+ 0 - 24
Unity/Assets/Scripts/Codes/HotfixView/Client/Demo/Unit/AfterUnitCreate_CreateUnitView.cs

@@ -1,24 +0,0 @@
-using UnityEngine;
-
-namespace ET.Client
-{
-    [Event(SceneType.Current)]
-    public class AfterUnitCreate_CreateUnitView: AEvent<EventType.AfterUnitCreate>
-    {
-        protected override async ETTask Run(Scene scene, EventType.AfterUnitCreate args)
-        {
-            Unit unit = args.Unit;
-            // Unit View层
-            // 这里可以改成异步加载,demo就不搞了
-            Log.Debug("===after create unit, to load model");
-            //GameObject bundleGameObject = (GameObject)ResourcesComponent.Instance.GetAsset("Unit.unity3d", "Unit");
-            //GameObject prefab = bundleGameObject.Get<GameObject>("Skeleton");
-	        
-            //GameObject go = UnityEngine.Object.Instantiate(prefab, GlobalComponent.Instance.Unit, true);
-            //go.transform.position = unit.Position;
-            //unit.AddComponent<GameObjectComponent>().GameObject = go;
-            //unit.AddComponent<AnimatorComponent>();
-            await ETTask.CompletedTask;
-        }
-    }
-}

+ 0 - 11
Unity/Assets/Scripts/Codes/HotfixView/Client/Demo/Unit/AfterUnitCreate_CreateUnitView.cs.meta

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

+ 0 - 220
Unity/Assets/Scripts/Codes/HotfixView/Client/Demo/Unit/AnimatorComponentSystem.cs

@@ -1,220 +0,0 @@
-using System;
-using UnityEngine;
-
-namespace ET.Client
-{
-	[FriendOf(typeof(AnimatorComponent))]
-	public static class AnimatorComponentSystem
-	{
-		[ObjectSystem]
-		public class AnimatorComponentAwakeSystem : AwakeSystem<AnimatorComponent>
-		{
-			protected override void Awake(AnimatorComponent self)
-			{
-				self.Awake();
-			}
-		}
-
-		[ObjectSystem]
-		public class AnimatorComponentUpdateSystem : UpdateSystem<AnimatorComponent>
-		{
-			protected override void Update(AnimatorComponent self)
-			{
-				self.Update();
-			}
-		}
-	
-		[ObjectSystem]
-		public class AnimatorComponentDestroySystem : DestroySystem<AnimatorComponent>
-		{
-			protected override void Destroy(AnimatorComponent self)
-			{
-				self.animationClips = null;
-				self.Parameter = null;
-				self.Animator = null;
-			}
-		}
-		
-		public static void Awake(this AnimatorComponent self)
-		{
-			Animator animator = self.GetParent<Unit>().GetComponent<GameObjectComponent>().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;
-		}
-	}
-}

+ 1 - 1
Unity/Assets/Scripts/Codes/ModelView/Client/Demo.meta → Unity/Assets/Scripts/Codes/HotfixView/Client/Opera.meta

@@ -1,5 +1,5 @@
 fileFormatVersion: 2
-guid: e995cd03c9bc1f14b8b4a18641af2121
+guid: 362d2bfa3a957c54ba2d3227bde87880
 folderAsset: yes
 DefaultImporter:
   externalObjects: {}

+ 1 - 2
Unity/Assets/Scripts/Codes/HotfixView/Client/Demo/Opera/OperaComponentSystem.cs → Unity/Assets/Scripts/Codes/HotfixView/Client/Opera/OperaComponentSystem.cs

@@ -1,4 +1,3 @@
-using System;
 using UnityEngine;
 
 namespace ET.Client
@@ -38,7 +37,7 @@ namespace ET.Client
                     EventSystem.Instance.Load();
                     Log.Debug("hot reload success!");
                 }
-            
+
                 if (Input.GetKeyDown(KeyCode.T))
                 {
                     C2M_TransferMap c2MTransferMap = new C2M_TransferMap();

+ 0 - 0
Unity/Assets/Scripts/Codes/HotfixView/Client/Demo/Opera/OperaComponentSystem.cs.meta → Unity/Assets/Scripts/Codes/HotfixView/Client/Opera/OperaComponentSystem.cs.meta


+ 0 - 8
Unity/Assets/Scripts/Codes/HotfixView/Client/UI/UIHelp.meta

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

+ 0 - 12
Unity/Assets/Scripts/Codes/HotfixView/Client/UI/UIHelp/SceneChangeFinishEvent_CreateUIHelp.cs

@@ -1,12 +0,0 @@
-namespace ET.Client
-{
-    [Event(SceneType.Current)]
-    public class SceneChangeFinishEvent_CreateUIHelp : AEvent<EventType.SceneChangeFinish>
-    {
-        protected override async ETTask Run(Scene scene, EventType.SceneChangeFinish args)
-        {
-            Log.Debug("===Scene changefinish, to create ui");
-            await ETTask.CompletedTask;
-        }
-    }
-}

+ 0 - 11
Unity/Assets/Scripts/Codes/HotfixView/Client/UI/UIHelp/SceneChangeFinishEvent_CreateUIHelp.cs.meta

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

+ 0 - 32
Unity/Assets/Scripts/Codes/HotfixView/Client/UI/UIHelp/UIHelpEvent.cs

@@ -1,32 +0,0 @@
-using System;
-using UnityEngine;
-
-namespace ET.Client
-{
-	[UIEvent(UIType.UIHelp)]
-    public class UIHelpEvent: AUIEvent
-    {
-        public override async ETTask<UI> OnCreate(UIComponent uiComponent, UILayer uiLayer)
-        {
-	        try
-	        {
-		        await uiComponent.DomainScene().GetComponent<ResourcesLoaderComponent>().LoadAsync(UIType.UIHelp.StringToAB());
-		        GameObject bundleGameObject = (GameObject) ResourcesComponent.Instance.GetAsset(UIType.UIHelp.StringToAB(), UIType.UIHelp);
-		        GameObject gameObject = UnityEngine.Object.Instantiate(bundleGameObject, UIEventComponent.Instance.GetLayer((int)uiLayer));
-		        UI ui = uiComponent.AddChild<UI, string, GameObject>(UIType.UIHelp, gameObject);
-
-				ui.AddComponent<UIHelpComponent>();
-				return ui;
-	        }
-	        catch (Exception e)
-	        {
-				Log.Error(e);
-		        return null;
-	        }
-		}
-
-        public override void OnRemove(UIComponent uiComponent)
-        {
-        }
-    }
-}

+ 0 - 11
Unity/Assets/Scripts/Codes/HotfixView/Client/UI/UIHelp/UIHelpEvent.cs.meta

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

+ 0 - 32
Unity/Assets/Scripts/Codes/HotfixView/Client/UI/UILogin/UILoginComponentSystem.cs

@@ -1,32 +0,0 @@
-using UnityEngine;
-using UnityEngine.UI;
-
-namespace ET.Client
-{
-	[FriendOf(typeof(UILoginComponent))]
-	public static class UILoginComponentSystem
-	{
-		[ObjectSystem]
-		public class UILoginComponentAwakeSystem : AwakeSystem<UILoginComponent>
-		{
-			protected override void Awake(UILoginComponent self)
-			{
-				ReferenceCollector rc = self.GetParent<UI>().GameObject.GetComponent<ReferenceCollector>();
-				self.loginBtn = rc.Get<GameObject>("LoginBtn");
-				
-				self.loginBtn.GetComponent<Button>().onClick.AddListener(()=> { self.OnLogin(); });
-				self.account = rc.Get<GameObject>("Account");
-				self.password = rc.Get<GameObject>("Password");
-			}
-		}
-
-		
-		public static void OnLogin(this UILoginComponent self)
-		{
-			LoginHelper.Login(
-				self.DomainScene(), 
-				self.account.GetComponent<InputField>().text, 
-				self.password.GetComponent<InputField>().text).Coroutine();
-		}
-	}
-}

+ 0 - 11
Unity/Assets/Scripts/Codes/HotfixView/Client/UI/UILogin/UILoginComponentSystem.cs.meta

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

+ 0 - 24
Unity/Assets/Scripts/Codes/HotfixView/Client/UI/UILogin/UILoginEvent.cs

@@ -1,24 +0,0 @@
-using System;
-using UnityEngine;
-
-namespace ET.Client
-{
-    [UIEvent(UIType.UILogin)]
-    public class UILoginEvent: AUIEvent
-    {
-        public override async ETTask<UI> OnCreate(UIComponent uiComponent, UILayer uiLayer)
-        {
-            await uiComponent.DomainScene().GetComponent<ResourcesLoaderComponent>().LoadAsync(UIType.UILogin.StringToAB());
-            GameObject bundleGameObject = (GameObject) ResourcesComponent.Instance.GetAsset(UIType.UILogin.StringToAB(), UIType.UILogin);
-            GameObject gameObject = UnityEngine.Object.Instantiate(bundleGameObject, UIEventComponent.Instance.GetLayer((int)uiLayer));
-            UI ui = uiComponent.AddChild<UI, string, GameObject>(UIType.UILogin, gameObject);
-            ui.AddComponent<UILoginComponent>();
-            return ui;
-        }
-
-        public override void OnRemove(UIComponent uiComponent)
-        {
-            ResourcesComponent.Instance.UnloadBundle(UIType.UILogin.StringToAB());
-        }
-    }
-}

+ 0 - 11
Unity/Assets/Scripts/Codes/HotfixView/Client/UI/UILogin/UILoginEvent.cs.meta

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

+ 220 - 0
Unity/Assets/Scripts/Codes/HotfixView/Client/Unit/AnimatorComponentSystem.cs

@@ -0,0 +1,220 @@
+using System;
+using UnityEngine;
+
+namespace ET.Client
+{
+    [FriendOf(typeof(AnimatorComponent))]
+    public static class AnimatorComponentSystem
+    {
+        [ObjectSystem]
+        public class AnimatorComponentAwakeSystem : AwakeSystem<AnimatorComponent>
+        {
+            protected override void Awake(AnimatorComponent self)
+            {
+                self.Awake();
+            }
+        }
+
+        [ObjectSystem]
+        public class AnimatorComponentUpdateSystem : UpdateSystem<AnimatorComponent>
+        {
+            protected override void Update(AnimatorComponent self)
+            {
+                self.Update();
+            }
+        }
+
+        [ObjectSystem]
+        public class AnimatorComponentDestroySystem : DestroySystem<AnimatorComponent>
+        {
+            protected override void Destroy(AnimatorComponent self)
+            {
+                self.animationClips = null;
+                self.Parameter = null;
+                self.Animator = null;
+            }
+        }
+
+        public static void Awake(this AnimatorComponent self)
+        {
+            Animator animator = self.GetParent<Unit>().GetComponent<GameObjectComponent>().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;
+        }
+    }
+}

+ 0 - 0
Unity/Assets/Scripts/Codes/HotfixView/Client/Demo/Unit/AnimatorComponentSystem.cs.meta → Unity/Assets/Scripts/Codes/HotfixView/Client/Unit/AnimatorComponentSystem.cs.meta


+ 1 - 1
Unity/Assets/Scripts/Codes/HotfixView/Client/Demo/Unit/ChangePosition_SyncGameObjectPos.cs → Unity/Assets/Scripts/Codes/HotfixView/Client/Unit/ChangePosition_SyncGameObjectPos.cs

@@ -3,7 +3,7 @@
 namespace ET.Client
 {
     [Event(SceneType.Current)]
-    public class ChangePosition_SyncGameObjectPos: AEvent<EventType.ChangePosition>
+    public class ChangePosition_SyncGameObjectPos : AEvent<EventType.ChangePosition>
     {
         protected override async ETTask Run(Scene scene, EventType.ChangePosition args)
         {

+ 0 - 0
Unity/Assets/Scripts/Codes/HotfixView/Client/Demo/Unit/ChangePosition_SyncGameObjectPos.cs.meta → Unity/Assets/Scripts/Codes/HotfixView/Client/Unit/ChangePosition_SyncGameObjectPos.cs.meta


+ 1 - 1
Unity/Assets/Scripts/Codes/HotfixView/Client/Demo/Unit/ChangeRotation_SyncGameObjectRotation.cs → Unity/Assets/Scripts/Codes/HotfixView/Client/Unit/ChangeRotation_SyncGameObjectRotation.cs

@@ -3,7 +3,7 @@ using UnityEngine;
 namespace ET.Client
 {
     [Event(SceneType.Current)]
-    public class ChangeRotation_SyncGameObjectRotation: AEvent<EventType.ChangeRotation>
+    public class ChangeRotation_SyncGameObjectRotation : AEvent<EventType.ChangeRotation>
     {
         protected override async ETTask Run(Scene scene, EventType.ChangeRotation args)
         {

+ 0 - 0
Unity/Assets/Scripts/Codes/HotfixView/Client/Demo/Unit/ChangeRotation_SyncGameObjectRotation.cs.meta → Unity/Assets/Scripts/Codes/HotfixView/Client/Unit/ChangeRotation_SyncGameObjectRotation.cs.meta


+ 2 - 4
Unity/Assets/Scripts/Codes/HotfixView/Client/Demo/Unit/GameObjectComponentSystem.cs → Unity/Assets/Scripts/Codes/HotfixView/Client/Unit/GameObjectComponentSystem.cs

@@ -1,11 +1,9 @@
-using System;
-
-namespace ET.Client
+namespace ET.Client
 {
     public static class GameObjectComponentSystem
     {
         [ObjectSystem]
-        public class DestroySystem: DestroySystem<GameObjectComponent>
+        public class DestroySystem : DestroySystem<GameObjectComponent>
         {
             protected override void Destroy(GameObjectComponent self)
             {

+ 0 - 0
Unity/Assets/Scripts/Codes/HotfixView/Client/Demo/Unit/GameObjectComponentSystem.cs.meta → Unity/Assets/Scripts/Codes/HotfixView/Client/Unit/GameObjectComponentSystem.cs.meta


+ 0 - 0
Unity/Assets/Scripts/Codes/ModelView/Client/Demo/Camera.meta → Unity/Assets/Scripts/Codes/ModelView/Client/Camera.meta


+ 3 - 2
Unity/Assets/Scripts/Codes/ModelView/Client/Demo/Camera/CameraComponent.cs → Unity/Assets/Scripts/Codes/ModelView/Client/Camera/CameraComponent.cs

@@ -2,12 +2,13 @@
 
 namespace ET.Client
 {
-	public class CameraComponent : Entity, IAwake, ILateUpdate
+    [ComponentOf(typeof(Unit))]
+    public class CameraComponent : Entity, IAwake, ILateUpdate
 	{
 		// 战斗摄像机
 		public Camera mainCamera;
 
-		public Unit Unit;
+		public Unit Unit{ get; set; }
 
 		public Camera MainCamera
 		{

+ 0 - 0
Unity/Assets/Scripts/Codes/ModelView/Client/Demo/Camera/CameraComponent.cs.meta → Unity/Assets/Scripts/Codes/ModelView/Client/Camera/CameraComponent.cs.meta


+ 0 - 8
Unity/Assets/Scripts/Codes/ModelView/Client/Demo/UI.meta

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

+ 0 - 8
Unity/Assets/Scripts/Codes/ModelView/Client/Demo/UI/UIHelp.meta

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

+ 0 - 11
Unity/Assets/Scripts/Codes/ModelView/Client/Demo/UI/UIHelp/UIHelpComponent.cs

@@ -1,11 +0,0 @@
-using UnityEngine;
-using UnityEngine.UI;
-
-namespace ET.Client
-{
-	[ComponentOf(typeof(UI))]
-	public class UIHelpComponent : Entity, IAwake
-	{
-		public Text text;
-	}
-}

+ 0 - 11
Unity/Assets/Scripts/Codes/ModelView/Client/Demo/UI/UIHelp/UIHelpComponent.cs.meta

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

+ 0 - 11
Unity/Assets/Scripts/Codes/ModelView/Client/Demo/UI/UILoading/UILoadingComponent.cs

@@ -1,11 +0,0 @@
-using UnityEngine;
-using UnityEngine.UI;
-
-namespace ET.Client
-{
-	[ComponentOf(typeof(UI))]
-	public class UILoadingComponent : Entity, IAwake
-	{
-		public Text text;
-	}
-}

+ 0 - 11
Unity/Assets/Scripts/Codes/ModelView/Client/Demo/UI/UILoading/UILoadingComponent.cs.meta

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

+ 0 - 8
Unity/Assets/Scripts/Codes/ModelView/Client/Demo/UI/UILobby.meta

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

+ 0 - 13
Unity/Assets/Scripts/Codes/ModelView/Client/Demo/UI/UILobby/UILobbyComponent.cs

@@ -1,13 +0,0 @@
-
-using UnityEngine;
-using UnityEngine.UI;
-
-namespace ET.Client
-{
-	[ComponentOf(typeof(UI))]
-	public class UILobbyComponent : Entity, IAwake
-	{
-		public GameObject enterMap;
-		public Text text;
-	}
-}

+ 0 - 11
Unity/Assets/Scripts/Codes/ModelView/Client/Demo/UI/UILobby/UILobbyComponent.cs.meta

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

+ 0 - 8
Unity/Assets/Scripts/Codes/ModelView/Client/Demo/UI/UILogin.meta

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

+ 0 - 12
Unity/Assets/Scripts/Codes/ModelView/Client/Demo/UI/UILogin/UILoginComponent.cs

@@ -1,12 +0,0 @@
-using UnityEngine;
-
-namespace ET.Client
-{
-	[ComponentOf(typeof(UI))]
-	public class UILoginComponent: Entity, IAwake
-	{
-		public GameObject account;
-		public GameObject password;
-		public GameObject loginBtn;
-	}
-}

+ 0 - 11
Unity/Assets/Scripts/Codes/ModelView/Client/Demo/UI/UILogin/UILoginComponent.cs.meta

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

+ 0 - 0
Unity/Assets/Scripts/Codes/ModelView/Client/Demo/Global.meta → Unity/Assets/Scripts/Codes/ModelView/Client/Global.meta


+ 1 - 1
Unity/Assets/Scripts/Codes/ModelView/Client/Demo/Global/GlobalComponent.cs → Unity/Assets/Scripts/Codes/ModelView/Client/Global/GlobalComponent.cs

@@ -10,6 +10,6 @@ namespace ET.Client
         
         public Transform Global;
         public Transform Unit { get; set; }
-        public Transform UI;
+        //public Transform UI;
     }
 }

+ 0 - 0
Unity/Assets/Scripts/Codes/ModelView/Client/Demo/Global/GlobalComponent.cs.meta → Unity/Assets/Scripts/Codes/ModelView/Client/Global/GlobalComponent.cs.meta


+ 0 - 0
Unity/Assets/Scripts/Codes/ModelView/Client/Demo/Opera.meta → Unity/Assets/Scripts/Codes/ModelView/Client/Opera.meta


+ 0 - 0
Unity/Assets/Scripts/Codes/ModelView/Client/Demo/Opera/OperaComponent.cs → Unity/Assets/Scripts/Codes/ModelView/Client/Opera/OperaComponent.cs


+ 0 - 0
Unity/Assets/Scripts/Codes/ModelView/Client/Demo/Opera/OperaComponent.cs.meta → Unity/Assets/Scripts/Codes/ModelView/Client/Opera/OperaComponent.cs.meta


+ 0 - 1
Unity/Assets/Scripts/Codes/ModelView/Client/Plugins/Example/ModelView.cs

@@ -1 +0,0 @@
-

+ 0 - 11
Unity/Assets/Scripts/Codes/ModelView/Client/Plugins/Example/ModelView.cs.meta

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

+ 0 - 0
Unity/Assets/Scripts/Codes/ModelView/Client/Demo/Unit.meta → Unity/Assets/Scripts/Codes/ModelView/Client/Unit.meta


+ 0 - 0
Unity/Assets/Scripts/Codes/ModelView/Client/Demo/Unit/AnimatorComponent.cs → Unity/Assets/Scripts/Codes/ModelView/Client/Unit/AnimatorComponent.cs


+ 0 - 0
Unity/Assets/Scripts/Codes/ModelView/Client/Demo/Unit/AnimatorComponent.cs.meta → Unity/Assets/Scripts/Codes/ModelView/Client/Unit/AnimatorComponent.cs.meta


+ 0 - 0
Unity/Assets/Scripts/Codes/ModelView/Client/Demo/Unit/GameObjectComponent.cs → Unity/Assets/Scripts/Codes/ModelView/Client/Unit/GameObjectComponent.cs


+ 0 - 0
Unity/Assets/Scripts/Codes/ModelView/Client/Demo/Unit/GameObjectComponent.cs.meta → Unity/Assets/Scripts/Codes/ModelView/Client/Unit/GameObjectComponent.cs.meta