Quellcode durchsuchen

增加了System接口约束,两点原因:
1.考虑到AwakeSystem参数经常跟AddComponent不匹配,造成运行时错误
2.增加了GetComponentSystem,因为GetComponent很频繁,如果先通过判断是否继承一个接口可以大大提升GetComponentSystem的效率,不然每次GetComponent都要多查一次字典,有点浪费性能

tanghai vor 4 Jahren
Ursprung
Commit
d92c9eec0d
86 geänderte Dateien mit 235 neuen und 119 gelöschten Zeilen
  1. 1 1
      Robot/Model/Module/RobotCase/RobotCase.cs
  2. 1 1
      Robot/Model/Module/RobotCase/RobotCaseComponent.cs
  3. 1 1
      Robot/Model/Module/RobotCase/RobotCaseDispatcherComponent.cs
  4. 1 1
      Robot/Model/Robot/RobotManagerComponent.cs
  5. 2 1
      Server/Model/Demo/AOI/AOIEntity.cs
  6. 1 1
      Server/Model/Demo/AOI/AOIManagerComponent.cs
  7. 1 1
      Server/Model/Demo/AOI/Cell.cs
  8. 1 1
      Server/Model/Demo/GateSessionKeyComponent.cs
  9. 1 1
      Server/Model/Demo/Player.cs
  10. 1 1
      Server/Model/Demo/PlayerComponent.cs
  11. 1 1
      Server/Model/Demo/Scene/GateMapComponent.cs
  12. 1 1
      Server/Model/Demo/SessionPlayerComponent.cs
  13. 1 1
      Server/Model/Demo/Unit/Unit.cs
  14. 1 1
      Server/Model/Demo/Unit/UnitComponent.cs
  15. 1 1
      Server/Model/Demo/Unit/UnitGateComponent.cs
  16. 1 1
      Server/Model/Module/Actor/ActorMessageDispatcherComponent.cs
  17. 1 1
      Server/Model/Module/Actor/ActorMessageSenderComponent.cs
  18. 1 1
      Server/Model/Module/Actor/MailBoxComponent.cs
  19. 1 1
      Server/Model/Module/ActorLocation/ActorLocationSender.cs
  20. 1 1
      Server/Model/Module/ActorLocation/ActorLocationSenderComponent.cs
  21. 2 2
      Server/Model/Module/ActorLocation/LocationComponent.cs
  22. 1 1
      Server/Model/Module/ActorLocation/LocationProxyComponent.cs
  23. 1 1
      Server/Model/Module/Console/ConsoleComponent.cs
  24. 1 1
      Server/Model/Module/Console/ModeContex.cs
  25. 1 1
      Server/Model/Module/DB/DBComponent.cs
  26. 1 1
      Server/Model/Module/Http/HttpComponent.cs
  27. 2 1
      Server/Model/Module/MessageInner/NetInnerComponent.cs
  28. 1 1
      Server/Model/Watcher/WatcherComponent.cs
  29. 1 1
      Unity/Assets/Scenes/Init.unity
  30. 0 3
      Unity/Codes/Hotfix/Demo/Scene/SceneChangeHelper.cs
  31. 23 14
      Unity/Codes/Model/Core/Object/Entity.cs
  32. 43 12
      Unity/Codes/Model/Core/Object/EventSystem.cs
  33. 25 5
      Unity/Codes/Model/Core/Object/IAwakeSystem.cs
  34. 5 1
      Unity/Codes/Model/Core/Object/IDeserializeSystem.cs
  35. 6 1
      Unity/Codes/Model/Core/Object/IDestroySystem.cs
  36. 34 0
      Unity/Codes/Model/Core/Object/IGetComponentSystem.cs
  37. 5 1
      Unity/Codes/Model/Core/Object/ILateUpdateSystem.cs
  38. 5 1
      Unity/Codes/Model/Core/Object/ILoadSystem.cs
  39. 5 1
      Unity/Codes/Model/Core/Object/IUpdateSystem.cs
  40. 1 1
      Unity/Codes/Model/Core/ObjectWait.cs
  41. 1 1
      Unity/Codes/Model/Core/Scene/ZoneSceneFlagComponent.cs
  42. 1 1
      Unity/Codes/Model/Core/Scene/ZoneSceneManagerComponent.cs
  43. 2 2
      Unity/Codes/Model/Core/Timer/TimerComponent.cs
  44. 1 1
      Unity/Codes/Model/Demo/AI/XunLuoPathComponent.cs
  45. 1 1
      Unity/Codes/Model/Demo/Move/MoveComponent.cs
  46. 1 1
      Unity/Codes/Model/Demo/Scene/CurrentScenesComponent.cs
  47. 1 1
      Unity/Codes/Model/Demo/Session/SessionComponent.cs
  48. 1 1
      Unity/Codes/Model/Demo/Unit/PlayerComponent.cs
  49. 1 1
      Unity/Codes/Model/Demo/Unit/Unit.cs
  50. 1 1
      Unity/Codes/Model/Demo/Unit/UnitComponent.cs
  51. 1 1
      Unity/Codes/Model/Module/AI/AIComponent.cs
  52. 1 1
      Unity/Codes/Model/Module/AI/AIDispatcherComponent.cs
  53. 1 1
      Unity/Codes/Model/Module/Config/ConfigComponent.cs
  54. 1 1
      Unity/Codes/Model/Module/CoroutineLock/CoroutineLock.cs
  55. 1 1
      Unity/Codes/Model/Module/CoroutineLock/CoroutineLockComponent.cs
  56. 1 1
      Unity/Codes/Model/Module/CoroutineLock/CoroutineLockQueue.cs
  57. 1 1
      Unity/Codes/Model/Module/CoroutineLock/CoroutineLockQueueType.cs
  58. 1 1
      Unity/Codes/Model/Module/Message/MessageDispatcherComponent.cs
  59. 4 2
      Unity/Codes/Model/Module/Message/NetKcpComponent.cs
  60. 1 1
      Unity/Codes/Model/Module/Message/NetThreadComponent.cs
  61. 1 1
      Unity/Codes/Model/Module/Message/OpcodeTypeComponent.cs
  62. 1 1
      Unity/Codes/Model/Module/Message/Session.cs
  63. 1 1
      Unity/Codes/Model/Module/Message/SessionAcceptTimeoutComponent.cs
  64. 1 1
      Unity/Codes/Model/Module/Message/SessionIdleCheckerComponent.cs
  65. 1 1
      Unity/Codes/Model/Module/Message/SessionStreamDispatcher.cs
  66. 1 1
      Unity/Codes/Model/Module/Numeric/NumericComponent.cs
  67. 1 1
      Unity/Codes/Model/Module/Numeric/NumericWatcherComponent.cs
  68. 1 1
      Unity/Codes/Model/Module/Ping/PingComponent.cs
  69. 1 1
      Unity/Codes/Model/Module/Recast/NavmeshComponent.cs
  70. 1 1
      Unity/Codes/Model/Module/Recast/PathfindingComponent.cs
  71. 1 1
      Unity/Codes/Model/Module/UnityWebRequest/UnityWebRequestAsync.cs
  72. 1 1
      Unity/Codes/Model/Module/UnityWebRequest/UnityWebRequestRenewalAsync.cs
  73. 1 1
      Unity/Codes/ModelView/Demo/Camera/CameraComponent.cs
  74. 1 1
      Unity/Codes/ModelView/Demo/Global/GlobalComponent.cs
  75. 1 1
      Unity/Codes/ModelView/Demo/Opera/OperaComponent.cs
  76. 2 2
      Unity/Codes/ModelView/Demo/Resource/ResourcesComponent.cs
  77. 1 1
      Unity/Codes/ModelView/Demo/Resource/ResourcesLoaderComponent.cs
  78. 1 1
      Unity/Codes/ModelView/Demo/Scene/SceneChangeComponent.cs
  79. 1 1
      Unity/Codes/ModelView/Demo/UI/UILoading/UILoadingComponent.cs
  80. 1 1
      Unity/Codes/ModelView/Demo/UI/UILobby/UILobbyComponent.cs
  81. 1 1
      Unity/Codes/ModelView/Demo/UI/UILogin/UILoginComponent.cs
  82. 1 1
      Unity/Codes/ModelView/Demo/Unit/AnimatorComponent.cs
  83. 1 1
      Unity/Codes/ModelView/Demo/Unit/GameObjectComponent.cs
  84. 1 1
      Unity/Codes/ModelView/Module/UI/UI.cs
  85. 1 1
      Unity/Codes/ModelView/Module/UI/UIComponent.cs
  86. 1 1
      Unity/Codes/ModelView/Module/UI/UIEventComponent.cs

+ 1 - 1
Robot/Model/Module/RobotCase/RobotCase.cs

@@ -2,7 +2,7 @@
 
 namespace ET
 {
-    public class RobotCase: Entity
+    public class RobotCase: Entity, IAwake
     {
         public ETCancellationToken CancellationToken;
         public string CommandLine;

+ 1 - 1
Robot/Model/Module/RobotCase/RobotCaseComponent.cs

@@ -2,7 +2,7 @@
 
 namespace ET
 {
-    public class RobotCaseComponent: Entity
+    public class RobotCaseComponent: Entity, IAwake, IDestroy
     {
         public static RobotCaseComponent Instance;
         public Dictionary<int, RobotCase> RobotCases = new Dictionary<int, RobotCase>();

+ 1 - 1
Robot/Model/Module/RobotCase/RobotCaseDispatcherComponent.cs

@@ -2,7 +2,7 @@
 
 namespace ET
 {
-    public class RobotCaseDispatcherComponent: Entity
+    public class RobotCaseDispatcherComponent: Entity, IAwake, ILoad
     {
         public static RobotCaseDispatcherComponent Instance;
         

+ 1 - 1
Robot/Model/Robot/RobotManagerComponent.cs

@@ -1,6 +1,6 @@
 namespace ET
 {
-    public class RobotManagerComponent: Entity
+    public class RobotManagerComponent: Entity, IAwake
     {
         
     }

+ 2 - 1
Server/Model/Demo/AOI/AOIEntity.cs

@@ -1,8 +1,9 @@
 using System.Collections.Generic;
+using UnityEngine;
 
 namespace ET
 {
-    public class AOIEntity: Entity
+    public class AOIEntity: Entity, IAwake<int, Vector3>, IDestroy
     {
         public Unit Unit => this.GetParent<Unit>();
 

+ 1 - 1
Server/Model/Demo/AOI/AOIManagerComponent.cs

@@ -1,6 +1,6 @@
 namespace ET
 {
-    public class AOIManagerComponent: Entity
+    public class AOIManagerComponent: Entity, IAwake
     {
         public static int CellSize = 10 * 1000;
     }

+ 1 - 1
Server/Model/Demo/AOI/Cell.cs

@@ -2,7 +2,7 @@
 
 namespace ET
 {
-    public class Cell: Entity
+    public class Cell: Entity, IAwake, IDestroy
     {
         // 处在这个cell的单位
         public Dictionary<long, AOIEntity> AOIUnits = new Dictionary<long, AOIEntity>();

+ 1 - 1
Server/Model/Demo/GateSessionKeyComponent.cs

@@ -2,7 +2,7 @@
 
 namespace ET
 {
-	public class GateSessionKeyComponent : Entity
+	public class GateSessionKeyComponent : Entity, IAwake
 	{
 		private readonly Dictionary<long, string> sessionKey = new Dictionary<long, string>();
 		

+ 1 - 1
Server/Model/Demo/Player.cs

@@ -9,7 +9,7 @@
 		}
 	}
 
-	public sealed class Player : Entity
+	public sealed class Player : Entity, IAwake<string>
 	{
 		public string Account { get; private set; }
 		

+ 1 - 1
Server/Model/Demo/PlayerComponent.cs

@@ -3,7 +3,7 @@ using System.Linq;
 
 namespace ET
 {
-	public class PlayerComponent : Entity
+	public class PlayerComponent : Entity, IAwake, IDestroy
 	{
 		private readonly Dictionary<long, Player> idPlayers = new Dictionary<long, Player>();
 		

+ 1 - 1
Server/Model/Demo/Scene/GateMapComponent.cs

@@ -1,6 +1,6 @@
 namespace ET
 {
-    public class GateMapComponent: Entity
+    public class GateMapComponent: Entity, IAwake
     {
         public Scene Scene;
     }

+ 1 - 1
Server/Model/Demo/SessionPlayerComponent.cs

@@ -1,6 +1,6 @@
 namespace ET
 {
-	public class SessionPlayerComponent : Entity
+	public class SessionPlayerComponent : Entity, IAwake, IDestroy
 	{
 		public long PlayerId;
 	}

+ 1 - 1
Server/Model/Demo/Unit/Unit.cs

@@ -4,7 +4,7 @@ using UnityEngine;
 
 namespace ET
 {
-    public sealed class Unit: Entity
+    public sealed class Unit: Entity, IAwake<int>
     {
         public int ConfigId; //配置表id
 

+ 1 - 1
Server/Model/Demo/Unit/UnitComponent.cs

@@ -1,6 +1,6 @@
 namespace ET
 {
-	public class UnitComponent: Entity
+	public class UnitComponent: Entity, IAwake, IDestroy
 	{
 	}
 }

+ 1 - 1
Server/Model/Demo/Unit/UnitGateComponent.cs

@@ -8,7 +8,7 @@
 		}
 	}
 
-	public class UnitGateComponent : Entity, ITransfer
+	public class UnitGateComponent : Entity, IAwake<long>, ITransfer
 	{
 		public long GateSessionActorId;
 

+ 1 - 1
Server/Model/Module/Actor/ActorMessageDispatcherComponent.cs

@@ -6,7 +6,7 @@ namespace ET
     /// <summary>
     /// Actor消息分发组件
     /// </summary>
-    public class ActorMessageDispatcherComponent: Entity
+    public class ActorMessageDispatcherComponent: Entity, IAwake, IDestroy, ILoad
     {
         public static ActorMessageDispatcherComponent Instance;
 

+ 1 - 1
Server/Model/Module/Actor/ActorMessageSenderComponent.cs

@@ -2,7 +2,7 @@
 
 namespace ET
 {
-    public class ActorMessageSenderComponent: Entity
+    public class ActorMessageSenderComponent: Entity, IAwake, IDestroy
     {
         public static long TIMEOUT_TIME = 40 * 1000;
 

+ 1 - 1
Server/Model/Module/Actor/MailBoxComponent.cs

@@ -3,7 +3,7 @@
     /// <summary>
     /// 挂上这个组件表示该Entity是一个Actor,接收的消息将会队列处理
     /// </summary>
-    public class MailBoxComponent: Entity
+    public class MailBoxComponent: Entity, IAwake, IAwake<MailboxType>
     {
         // Mailbox的类型
         public MailboxType MailboxType;

+ 1 - 1
Server/Model/Module/ActorLocation/ActorLocationSender.cs

@@ -3,7 +3,7 @@
 namespace ET
 {
     // 知道对方的Id,使用这个类发actor消息
-    public class ActorLocationSender: Entity
+    public class ActorLocationSender: Entity, IAwake, IDestroy
     {
         public long ActorId;
 

+ 1 - 1
Server/Model/Module/ActorLocation/ActorLocationSenderComponent.cs

@@ -2,7 +2,7 @@
 
 namespace ET
 {
-    public class ActorLocationSenderComponent: Entity
+    public class ActorLocationSenderComponent: Entity, IAwake, IDestroy
     {
         public static long TIMEOUT_TIME = 60 * 1000;
 

+ 2 - 2
Server/Model/Module/ActorLocation/LocationComponent.cs

@@ -12,7 +12,7 @@ namespace ET
         }
     }
 
-    public class LockInfo: Entity
+    public class LockInfo: Entity, IAwake<long, CoroutineLock>
     {
         public long LockInstanceId;
 
@@ -32,7 +32,7 @@ namespace ET
         }
     }
 
-    public class LocationComponent: Entity
+    public class LocationComponent: Entity, IAwake
     {
         public readonly Dictionary<long, long> locations = new Dictionary<long, long>();
 

+ 1 - 1
Server/Model/Module/ActorLocation/LocationProxyComponent.cs

@@ -1,6 +1,6 @@
 namespace ET
 {
-    public class LocationProxyComponent: Entity
+    public class LocationProxyComponent: Entity, IAwake, IDestroy
     {
         public static LocationProxyComponent Instance;
     }

+ 1 - 1
Server/Model/Module/Console/ConsoleComponent.cs

@@ -14,7 +14,7 @@ namespace ET
         public const string Robot = "Robot";
     }
 
-    public class ConsoleComponent: Entity
+    public class ConsoleComponent: Entity, IAwake, ILoad
     {
         public CancellationTokenSource CancellationTokenSource;
         public Dictionary<string, IConsoleHandler> Handlers = new Dictionary<string, IConsoleHandler>();

+ 1 - 1
Server/Model/Module/Console/ModeContex.cs

@@ -18,7 +18,7 @@
         }
     }
 
-    public class ModeContex: Entity
+    public class ModeContex: Entity, IAwake, IDestroy
     {
         public string Mode = "";
     }

+ 1 - 1
Server/Model/Module/DB/DBComponent.cs

@@ -7,7 +7,7 @@ namespace ET
 	/// <summary>
 	/// 用来缓存数据
 	/// </summary>
-	public class DBComponent : Entity
+	public class DBComponent : Entity, IAwake<string, string>, IDestroy
 	{
 		public static DBComponent Instance;
 		

+ 1 - 1
Server/Model/Module/Http/HttpComponent.cs

@@ -6,7 +6,7 @@ namespace ET
     /// <summary>
     /// http请求分发器
     /// </summary>
-    public class HttpComponent: Entity
+    public class HttpComponent: Entity, IAwake<string>, IDestroy, ILoad
     {
         public HttpListener Listener;
         public Dictionary<string, IHttpHandler> dispatcher;

+ 2 - 1
Server/Model/Module/MessageInner/NetInnerComponent.cs

@@ -1,6 +1,7 @@
 using System;
 using System.Collections.Concurrent;
 using System.Collections.Generic;
+using System.Net;
 
 namespace ET
 {
@@ -18,7 +19,7 @@ namespace ET
         }
     }
 
-    public class NetInnerComponent: Entity
+    public class NetInnerComponent: Entity, IAwake<IPEndPoint, int>, IAwake<int>, IDestroy
     {
         public AService Service;
 

+ 1 - 1
Server/Model/Watcher/WatcherComponent.cs

@@ -3,7 +3,7 @@ using System.Diagnostics;
 
 namespace ET
 {
-    public class WatcherComponent: Entity
+    public class WatcherComponent: Entity, IAwake, IDestroy
     {
         public static WatcherComponent Instance { get; set; }
 

+ 1 - 1
Unity/Assets/Scenes/Init.unity

@@ -417,7 +417,7 @@ MonoBehaviour:
   m_Script: {fileID: 11500000, guid: ff906ecbbd0163f4094f8fa4e305d39f, type: 3}
   m_Name: 
   m_EditorClassIdentifier: 
-  CodeMode: 1
+  CodeMode: 2
 --- !u!4 &575235020
 Transform:
   m_ObjectHideFlags: 0

+ 0 - 3
Unity/Codes/Hotfix/Demo/Scene/SceneChangeHelper.cs

@@ -8,12 +8,9 @@
             // 可以订阅这个事件中创建Loading界面
             Game.EventSystem.Publish(new EventType.SceneChangeStart() {ZoneScene = zoneScene});
             
-            Log.Debug($"11111111111111111111111111111111111111111111111111a1");
             CurrentScenesComponent currentScenesComponent = zoneScene.GetComponent<CurrentScenesComponent>();
-            Log.Debug($"11111111111111111111111111111111111111111111111111a2");
             currentScenesComponent.Scene?.Dispose(); // 删除之前的CurrentScene,创建新的
             Scene currentScene = SceneFactory.CreateCurrentScene(sceneInstanceId, zoneScene.Zone, sceneName, currentScenesComponent);
-            Log.Debug($"11111111111111111111111111111111111111111111111111a3");
             UnitComponent unitComponent = currentScene.AddComponent<UnitComponent>();
 
             // 等待CreateMyUnit的消息

+ 23 - 14
Unity/Codes/Model/Core/Object/Entity.cs

@@ -478,7 +478,10 @@ namespace ET
             }
 
             // 触发Destroy事件
-            EventSystem.Instance.Destroy(this);
+            if (this is IDestroy)
+            {
+                EventSystem.Instance.Destroy(this);
+            }
 
             this.domain = null;
 
@@ -655,6 +658,12 @@ namespace ET
                 return default;
             }
 
+            // 如果有IGetComponent接口,则触发GetComponentSystem
+            if (component is IGetComponent)
+            {
+                EventSystem.Instance.GetComponent(component);
+            }
+
             return (K) component;
         }
 
@@ -718,7 +727,7 @@ namespace ET
             return component;
         }
 
-        public K AddComponent<K>(bool isFromPool = false) where K : Entity, new()
+        public K AddComponent<K>(bool isFromPool = false) where K : Entity, IAwake, new()
         {
             Type type = typeof (K);
             if (this.components != null && this.components.ContainsKey(type))
@@ -733,7 +742,7 @@ namespace ET
             return component as K;
         }
 
-        public K AddComponent<K, P1>(P1 p1, bool isFromPool = false) where K : Entity, new()
+        public K AddComponent<K, P1>(P1 p1, bool isFromPool = false) where K : Entity, IAwake<P1>, new()
         {
             Type type = typeof (K);
             if (this.components != null && this.components.ContainsKey(type))
@@ -748,7 +757,7 @@ namespace ET
             return component as K;
         }
 
-        public K AddComponent<K, P1, P2>(P1 p1, P2 p2, bool isFromPool = false) where K : Entity, new()
+        public K AddComponent<K, P1, P2>(P1 p1, P2 p2, bool isFromPool = false) where K : Entity, IAwake<P1, P2>, new()
         {
             Type type = typeof (K);
             if (this.components != null && this.components.ContainsKey(type))
@@ -763,7 +772,7 @@ namespace ET
             return component as K;
         }
 
-        public K AddComponent<K, P1, P2, P3>(P1 p1, P2 p2, P3 p3, bool isFromPool = false) where K : Entity, new()
+        public K AddComponent<K, P1, P2, P3>(P1 p1, P2 p2, P3 p3, bool isFromPool = false) where K : Entity, IAwake<P1, P2, P3>, new()
         {
             Type type = typeof (K);
             if (this.components != null && this.components.ContainsKey(type))
@@ -784,7 +793,7 @@ namespace ET
             return entity;
         }
 
-        public T AddChild<T>(bool isFromPool = false) where T : Entity
+        public T AddChild<T>(bool isFromPool = false) where T : Entity, IAwake
         {
             Type type = typeof (T);
             T component = (T) Entity.Create(type, isFromPool);
@@ -795,7 +804,7 @@ namespace ET
             return component;
         }
 
-        public T AddChild<T, A>(A a, bool isFromPool = false) where T : Entity
+        public T AddChild<T, A>(A a, bool isFromPool = false) where T : Entity, IAwake<A>
         {
             Type type = typeof (T);
             T component = (T) Entity.Create(type, isFromPool);
@@ -806,7 +815,7 @@ namespace ET
             return component;
         }
 
-        public T AddChild<T, A, B>(A a, B b, bool isFromPool = false) where T : Entity
+        public T AddChild<T, A, B>(A a, B b, bool isFromPool = false) where T : Entity, IAwake<A, B>
         {
             Type type = typeof (T);
             T component = (T) Entity.Create(type, isFromPool);
@@ -817,7 +826,7 @@ namespace ET
             return component;
         }
 
-        public T AddChild<T, A, B, C>(A a, B b, C c, bool isFromPool = false) where T : Entity
+        public T AddChild<T, A, B, C>(A a, B b, C c, bool isFromPool = false) where T : Entity, IAwake<A, B, C>
         {
             Type type = typeof (T);
             T component = (T) Entity.Create(type, isFromPool);
@@ -828,7 +837,7 @@ namespace ET
             return component;
         }
 
-        public T AddChild<T, A, B, C, D>(A a, B b, C c, D d, bool isFromPool = false) where T : Entity
+        public T AddChild<T, A, B, C, D>(A a, B b, C c, D d, bool isFromPool = false) where T : Entity, IAwake<A, B, C, D>
         {
             Type type = typeof (T);
             T component = (T) Entity.Create(type, isFromPool);
@@ -839,7 +848,7 @@ namespace ET
             return component;
         }
 
-        public T AddChildWithId<T>(long id, bool isFromPool = false) where T : Entity, new()
+        public T AddChildWithId<T>(long id, bool isFromPool = false) where T : Entity, IAwake, new()
         {
             Type type = typeof (T);
             T component = Entity.Create(type, isFromPool) as T;
@@ -849,7 +858,7 @@ namespace ET
             return component;
         }
 
-        public T AddChildWithId<T, A>(long id, A a, bool isFromPool = false) where T : Entity
+        public T AddChildWithId<T, A>(long id, A a, bool isFromPool = false) where T : Entity, IAwake<A>
         {
             Type type = typeof (T);
             T component = (T) Entity.Create(type, isFromPool);
@@ -860,7 +869,7 @@ namespace ET
             return component;
         }
 
-        public T AddChildWithId<T, A, B>(long id, A a, B b, bool isFromPool = false) where T : Entity
+        public T AddChildWithId<T, A, B>(long id, A a, B b, bool isFromPool = false) where T : Entity, IAwake<A, B>
         {
             Type type = typeof (T);
             T component = (T) Entity.Create(type, isFromPool);
@@ -871,7 +880,7 @@ namespace ET
             return component;
         }
 
-        public T AddChildWithId<T, A, B, C>(long id, A a, B b, C c, bool isFromPool = false) where T : Entity
+        public T AddChildWithId<T, A, B, C>(long id, A a, B b, C c, bool isFromPool = false) where T : Entity, IAwake<A, B, C>
         {
             Type type = typeof (T);
             T component = (T) Entity.Create(type, isFromPool);

+ 43 - 12
Unity/Codes/Model/Core/Object/EventSystem.cs

@@ -218,25 +218,29 @@ namespace ET
 
             Type type = component.GetType();
 
-            OneTypeSystems oneTypeSystems = this.typeSystems.GetOneTypeSystems(type);
-            if (oneTypeSystems == null)
+            OneTypeSystems oneTypeSystems = this.typeSystems.GetOneTypeSystems(type);;
+            if (component is ILoad)
             {
-                return;
-            }
-
-            if (oneTypeSystems.ContainsKey(typeof (ILoadSystem)))
-            {
-                this.loaders.Enqueue(component.InstanceId);
+                if (oneTypeSystems.ContainsKey(typeof (ILoadSystem)))
+                {
+                    this.loaders.Enqueue(component.InstanceId);
+                }
             }
 
-            if (oneTypeSystems.ContainsKey(typeof (IUpdateSystem)))
+            if (component is IUpdate)
             {
-                this.updates.Enqueue(component.InstanceId);
+                if (oneTypeSystems.ContainsKey(typeof (IUpdateSystem)))
+                {
+                    this.updates.Enqueue(component.InstanceId);
+                }
             }
 
-            if (oneTypeSystems.ContainsKey(typeof (ILateUpdateSystem)))
+            if (component is ILateUpdate)
             {
-                this.lateUpdates.Enqueue(component.InstanceId);
+                if (oneTypeSystems.ContainsKey(typeof (ILateUpdateSystem)))
+                {
+                    this.lateUpdates.Enqueue(component.InstanceId);
+                }
             }
         }
 
@@ -282,6 +286,33 @@ namespace ET
                 }
             }
         }
+        
+        // GetComponentSystem
+        public void GetComponent(Entity component)
+        {
+            List<object> iGetSystem = this.typeSystems.GetSystems(component.GetType(), typeof (IGetComponentSystem));
+            if (iGetSystem == null)
+            {
+                return;
+            }
+
+            foreach (IGetComponentSystem getSystem in iGetSystem)
+            {
+                if (getSystem == null)
+                {
+                    continue;
+                }
+
+                try
+                {
+                    getSystem.Run(component);
+                }
+                catch (Exception e)
+                {
+                    Log.Error(e);
+                }
+            }
+        }
 
         public void Awake(Entity component)
         {

+ 25 - 5
Unity/Codes/Model/Core/Object/IAwakeSystem.cs

@@ -2,6 +2,26 @@ using System;
 
 namespace ET
 {
+    public interface IAwake
+    {
+    }
+
+    public interface IAwake<A>
+    {
+    }
+	
+    public interface IAwake<A, B>
+    {
+    }
+	
+    public interface IAwake<A, B, C>
+    {
+    }
+	
+    public interface IAwake<A, B, C, D>
+    {
+    }
+    
     public interface IAwakeSystem: ISystemType
     {
         void Run(object o);
@@ -28,7 +48,7 @@ namespace ET
     }
 
     [ObjectSystem]
-    public abstract class AwakeSystem<T> : IAwakeSystem
+    public abstract class AwakeSystem<T> : IAwakeSystem where T: IAwake
     {
         public Type Type()
         {
@@ -49,7 +69,7 @@ namespace ET
     }
     
     [ObjectSystem]
-    public abstract class AwakeSystem<T, A> : IAwakeSystem<A>
+    public abstract class AwakeSystem<T, A> : IAwakeSystem<A> where T: IAwake<A>
     {
         public Type Type()
         {
@@ -70,7 +90,7 @@ namespace ET
     }
 
     [ObjectSystem]
-    public abstract class AwakeSystem<T, A, B> : IAwakeSystem<A, B>
+    public abstract class AwakeSystem<T, A, B> : IAwakeSystem<A, B> where T: IAwake<A, B>
     {
         public Type Type()
         {
@@ -91,7 +111,7 @@ namespace ET
     }
 
     [ObjectSystem]
-    public abstract class AwakeSystem<T, A, B, C> : IAwakeSystem<A, B, C>
+    public abstract class AwakeSystem<T, A, B, C> : IAwakeSystem<A, B, C> where T: IAwake<A, B, C>
     {
         public Type Type()
         {
@@ -112,7 +132,7 @@ namespace ET
     }
     
     [ObjectSystem]
-    public abstract class AwakeSystem<T, A, B, C, D> : IAwakeSystem<A, B, C, D>
+    public abstract class AwakeSystem<T, A, B, C, D> : IAwakeSystem<A, B, C, D> where T: IAwake<A, B, C, D>
     {
         public Type Type()
         {

+ 5 - 1
Unity/Codes/Model/Core/Object/IDeserializeSystem.cs

@@ -2,6 +2,10 @@
 
 namespace ET
 {
+	public interface IDeserialize
+	{
+	}
+	
 	public interface IDeserializeSystem: ISystemType
 	{
 		void Run(object o);
@@ -13,7 +17,7 @@ namespace ET
 	/// </summary>
 	/// <typeparam name="T"></typeparam>
 	[ObjectSystem]
-	public abstract class DeserializeSystem<T> : IDeserializeSystem
+	public abstract class DeserializeSystem<T> : IDeserializeSystem where T: IDeserialize
 	{
 		public void Run(object o)
 		{

+ 6 - 1
Unity/Codes/Model/Core/Object/IDestroySystem.cs

@@ -2,13 +2,18 @@
 
 namespace ET
 {
+	public interface IDestroy
+	{
+		
+	}
+	
 	public interface IDestroySystem: ISystemType
 	{
 		void Run(object o);
 	}
 
 	[ObjectSystem]
-	public abstract class DestroySystem<T> : IDestroySystem
+	public abstract class DestroySystem<T> : IDestroySystem where T: IDestroy
 	{
 		public void Run(object o)
 		{

+ 34 - 0
Unity/Codes/Model/Core/Object/IGetComponentSystem.cs

@@ -0,0 +1,34 @@
+using System;
+
+namespace ET
+{
+	public interface IGetComponent
+	{
+	}
+	
+	public interface IGetComponentSystem: ISystemType
+	{
+		void Run(object o);
+	}
+
+	[ObjectSystem]
+	public abstract class GetComponentSystem<T> : IGetComponentSystem where T: IGetComponent
+	{
+		public void Run(object o)
+		{
+			this.GetComponent((T)o);
+		}
+		
+		public Type SystemType()
+		{
+			return typeof(IGetComponentSystem);
+		}
+
+		public Type Type()
+		{
+			return typeof(T);
+		}
+
+		public abstract void GetComponent(T self);
+	}
+}

+ 5 - 1
Unity/Codes/Model/Core/Object/ILateUpdateSystem.cs

@@ -2,13 +2,17 @@
 
 namespace ET
 {
+	public interface ILateUpdate
+	{
+	}
+	
 	public interface ILateUpdateSystem: ISystemType
 	{
 		void Run(object o);
 	}
 
 	[ObjectSystem]
-	public abstract class LateUpdateSystem<T> : ILateUpdateSystem
+	public abstract class LateUpdateSystem<T> : ILateUpdateSystem where T: ILateUpdate
 	{
 		public void Run(object o)
 		{

+ 5 - 1
Unity/Codes/Model/Core/Object/ILoadSystem.cs

@@ -2,13 +2,17 @@
 
 namespace ET
 {
+	public interface ILoad
+	{
+	}
+	
 	public interface ILoadSystem: ISystemType
 	{
 		void Run(object o);
 	}
 
 	[ObjectSystem]
-	public abstract class LoadSystem<T> : ILoadSystem
+	public abstract class LoadSystem<T> : ILoadSystem where T: ILoad
 	{
 		public void Run(object o)
 		{

+ 5 - 1
Unity/Codes/Model/Core/Object/IUpdateSystem.cs

@@ -2,13 +2,17 @@
 
 namespace ET
 {
+	public interface IUpdate
+	{
+	}
+	
 	public interface IUpdateSystem: ISystemType
 	{
 		void Run(object o);
 	}
 
 	[ObjectSystem]
-	public abstract class UpdateSystem<T> : IUpdateSystem
+	public abstract class UpdateSystem<T> : IUpdateSystem where T: IUpdate
 	{
 		public void Run(object o)
 		{

+ 1 - 1
Unity/Codes/Model/Core/ObjectWait.cs

@@ -42,7 +42,7 @@ namespace ET
         }
     }
 
-    public class ObjectWait: Entity
+    public class ObjectWait: Entity, IAwake, IDestroy
     {
         public interface IDestroyRun
         {

+ 1 - 1
Unity/Codes/Model/Core/Scene/ZoneSceneFlagComponent.cs

@@ -2,7 +2,7 @@
 
 namespace ET
 {
-    public class ZoneSceneFlagComponent: Entity
+    public class ZoneSceneFlagComponent: Entity, IAwake, IDestroy
     {
     }
 }

+ 1 - 1
Unity/Codes/Model/Core/Scene/ZoneSceneManagerComponent.cs

@@ -2,7 +2,7 @@ using System.Collections.Generic;
 
 namespace ET
 {
-    public class ZoneSceneManagerComponent: Entity
+    public class ZoneSceneManagerComponent: Entity, IAwake, IDestroy
     {
         public static ZoneSceneManagerComponent Instance;
         public Dictionary<int, Scene> ZoneScenes = new Dictionary<int, Scene>();

+ 2 - 2
Unity/Codes/Model/Core/Timer/TimerComponent.cs

@@ -35,7 +35,7 @@ namespace ET
         }
     }
     
-    public class TimerAction: Entity
+    public class TimerAction: Entity, IAwake, IAwake<TimerClass, long, int, object>, IDestroy
     {
         public TimerClass TimerClass;
 
@@ -74,7 +74,7 @@ namespace ET
         }
     }
 
-    public class TimerComponent: Entity
+    public class TimerComponent: Entity, IAwake, IUpdate, ILoad
     {
         public static TimerComponent Instance
         {

+ 1 - 1
Unity/Codes/Model/Demo/AI/XunLuoPathComponent.cs

@@ -2,7 +2,7 @@ using UnityEngine;
 
 namespace ET
 {
-    public class XunLuoPathComponent: Entity
+    public class XunLuoPathComponent: Entity, IAwake
     {
         public Vector3[] path = new Vector3[] { new Vector3(0, 0, 0), new Vector3(20, 0, 0), new Vector3(20, 0, 20), new Vector3(0, 0, 20), };
 

+ 1 - 1
Unity/Codes/Model/Demo/Move/MoveComponent.cs

@@ -4,7 +4,7 @@ using UnityEngine;
 
 namespace ET
 {
-    public class MoveComponent: Entity
+    public class MoveComponent: Entity, IAwake, IDestroy
     {
         public Vector3 PreTarget
         {

+ 1 - 1
Unity/Codes/Model/Demo/Scene/CurrentScenesComponent.cs

@@ -1,7 +1,7 @@
 namespace ET
 {
     // 可以用来管理多个客户端场景,比如大世界会加载多块场景
-    public class CurrentScenesComponent: Entity
+    public class CurrentScenesComponent: Entity, IAwake
     {
         public Scene Scene;
     }

+ 1 - 1
Unity/Codes/Model/Demo/Session/SessionComponent.cs

@@ -1,6 +1,6 @@
 namespace ET
 {
-	public class SessionComponent: Entity
+	public class SessionComponent: Entity, IAwake, IDestroy
 	{
 		public Session Session;
 	}

+ 1 - 1
Unity/Codes/Model/Demo/Unit/PlayerComponent.cs

@@ -1,6 +1,6 @@
 namespace ET
 {
-    public class PlayerComponent: Entity
+    public class PlayerComponent: Entity, IAwake
     {
         public long MyId;
     }

+ 1 - 1
Unity/Codes/Model/Demo/Unit/Unit.cs

@@ -4,7 +4,7 @@ using UnityEngine;
 
 namespace ET
 {
-    public class Unit: Entity
+    public class Unit: Entity, IAwake<int>
     {
         public int ConfigId; //配置表id
 

+ 1 - 1
Unity/Codes/Model/Demo/Unit/UnitComponent.cs

@@ -1,6 +1,6 @@
 namespace ET
 {
-	public class UnitComponent: Entity
+	public class UnitComponent: Entity, IAwake, IDestroy
 	{
 	}
 }

+ 1 - 1
Unity/Codes/Model/Module/AI/AIComponent.cs

@@ -1,7 +1,7 @@
 namespace ET
 {
     // 客户端挂在ZoneScene上,服务端挂在Unit上
-    public class AIComponent: Entity
+    public class AIComponent: Entity, IAwake<int>, IDestroy
     {
         public int AIConfigId;
         

+ 1 - 1
Unity/Codes/Model/Module/AI/AIDispatcherComponent.cs

@@ -2,7 +2,7 @@ using System.Collections.Generic;
 
 namespace ET
 {
-    public class AIDispatcherComponent: Entity
+    public class AIDispatcherComponent: Entity, IAwake, IDestroy, ILoad
     {
         public static AIDispatcherComponent Instance;
         

+ 1 - 1
Unity/Codes/Model/Module/Config/ConfigComponent.cs

@@ -6,7 +6,7 @@ namespace ET
     /// <summary>
     /// Config组件会扫描所有的有ConfigAttribute标签的配置,加载进来
     /// </summary>
-    public class ConfigComponent: Entity
+    public class ConfigComponent: Entity, IAwake, IDestroy
     {
         public IConfigLoader ConfigLoader;
         

+ 1 - 1
Unity/Codes/Model/Module/CoroutineLock/CoroutineLock.cs

@@ -33,7 +33,7 @@ namespace ET
         }
     }
     
-    public class CoroutineLock: Entity
+    public class CoroutineLock: Entity, IAwake<int, long, int>, IDestroy
     {
         public int coroutineLockType;
         public long key;

+ 1 - 1
Unity/Codes/Model/Module/CoroutineLock/CoroutineLockComponent.cs

@@ -167,7 +167,7 @@ namespace ET
         }
     }
 
-    public class CoroutineLockComponent: Entity
+    public class CoroutineLockComponent: Entity, IAwake, IUpdate, IDestroy
     {
         public static CoroutineLockComponent Instance;
 

+ 1 - 1
Unity/Codes/Model/Module/CoroutineLock/CoroutineLockQueue.cs

@@ -26,7 +26,7 @@ namespace ET
         public int Time;
     }
     
-    public class CoroutineLockQueue: Entity
+    public class CoroutineLockQueue: Entity, IAwake, IDestroy
     {
         public Queue<CoroutineLockInfo> queue = new Queue<CoroutineLockInfo>();
 

+ 1 - 1
Unity/Codes/Model/Module/CoroutineLock/CoroutineLockQueueType.cs

@@ -26,7 +26,7 @@ namespace ET
         }
     }
     
-    public class CoroutineLockQueueType: Entity
+    public class CoroutineLockQueueType: Entity, IAwake, IDestroy
     {
         public Dictionary<long, CoroutineLockQueue> dictionary;
 

+ 1 - 1
Unity/Codes/Model/Module/Message/MessageDispatcherComponent.cs

@@ -5,7 +5,7 @@ namespace ET
     /// <summary>
     /// 消息分发组件
     /// </summary>
-    public class MessageDispatcherComponent: Entity
+    public class MessageDispatcherComponent: Entity, IAwake, IDestroy, ILoad
     {
         public static MessageDispatcherComponent Instance
         {

+ 4 - 2
Unity/Codes/Model/Module/Message/NetKcpComponent.cs

@@ -1,6 +1,8 @@
-namespace ET
+using System.Net;
+
+namespace ET
 {
-    public class NetKcpComponent: Entity
+    public class NetKcpComponent: Entity, IAwake<int>, IAwake<IPEndPoint, int>, IDestroy
     {
         public AService Service;
         

+ 1 - 1
Unity/Codes/Model/Module/Message/NetThreadComponent.cs

@@ -5,7 +5,7 @@ using System.Threading;
 
 namespace ET
 {
-    public class NetThreadComponent: Entity
+    public class NetThreadComponent: Entity, IAwake, ILateUpdate, IDestroy
     {
         public static NetThreadComponent Instance;
         

+ 1 - 1
Unity/Codes/Model/Module/Message/OpcodeTypeComponent.cs

@@ -22,7 +22,7 @@ namespace ET
         }
     }
 
-    public class OpcodeTypeComponent: Entity
+    public class OpcodeTypeComponent: Entity, IAwake, IDestroy
     {
         public static OpcodeTypeComponent Instance;
         

+ 1 - 1
Unity/Codes/Model/Module/Message/Session.cs

@@ -15,7 +15,7 @@ namespace ET
         }
     }
 
-    public sealed class Session: Entity
+    public sealed class Session: Entity, IAwake<AService>
     {
         private readonly struct RpcInfo
         {

+ 1 - 1
Unity/Codes/Model/Module/Message/SessionAcceptTimeoutComponent.cs

@@ -1,7 +1,7 @@
 namespace ET
 {
     // 刚accept的session只持续5秒,必须通过验证,否则断开
-    public class SessionAcceptTimeoutComponent: Entity
+    public class SessionAcceptTimeoutComponent: Entity, IAwake, IDestroy
     {
         public long Timer;
     }

+ 1 - 1
Unity/Codes/Model/Module/Message/SessionIdleCheckerComponent.cs

@@ -1,6 +1,6 @@
 namespace ET
 {
-    public class SessionIdleCheckerComponent: Entity
+    public class SessionIdleCheckerComponent: Entity, IAwake<int>, IDestroy
     {
         public long RepeatedTimer;
     }

+ 1 - 1
Unity/Codes/Model/Module/Message/SessionStreamDispatcher.cs

@@ -1,6 +1,6 @@
 namespace ET
 {
-    public class SessionStreamDispatcher: Entity
+    public class SessionStreamDispatcher: Entity, IAwake, IDestroy, ILoad
     {
         public static SessionStreamDispatcher Instance;
         public ISessionStreamDispatcher[] Dispatchers;

+ 1 - 1
Unity/Codes/Model/Module/Numeric/NumericComponent.cs

@@ -24,7 +24,7 @@ namespace ET
 		}
 	}
 
-	public class NumericComponent: Entity, ITransfer
+	public class NumericComponent: Entity, IAwake, ITransfer
 	{
 		[BsonDictionaryOptions(DictionaryRepresentation.ArrayOfArrays)]
 		public Dictionary<int, long> NumericDic = new Dictionary<int, long>();

+ 1 - 1
Unity/Codes/Model/Module/Numeric/NumericWatcherComponent.cs

@@ -25,7 +25,7 @@ namespace ET
 	/// <summary>
 	/// 监视数值变化组件,分发监听
 	/// </summary>
-	public class NumericWatcherComponent : Entity
+	public class NumericWatcherComponent : Entity, IAwake, ILoad
 	{
 		public static NumericWatcherComponent Instance { get; set; }
 		

+ 1 - 1
Unity/Codes/Model/Module/Ping/PingComponent.cs

@@ -1,6 +1,6 @@
 namespace ET
 {
-    public class PingComponent: Entity
+    public class PingComponent: Entity, IAwake, IDestroy
     {
         [NoMemoryCheck]
         public C2G_Ping C2G_Ping = new C2G_Ping();

+ 1 - 1
Unity/Codes/Model/Module/Recast/NavmeshComponent.cs

@@ -3,7 +3,7 @@ using System.Collections.Generic;
 
 namespace ET
 {
-    public class NavmeshComponent: Entity
+    public class NavmeshComponent: Entity, IAwake<Func<string, byte[]>>
     {
         public static NavmeshComponent Instance;
         

+ 1 - 1
Unity/Codes/Model/Module/Recast/PathfindingComponent.cs

@@ -5,7 +5,7 @@ namespace ET
     /// <summary>
     /// 同一块地图可能有多种寻路数据,玩家可以随时切换,怪物也可能跟玩家的寻路不一样,寻路组件应该挂在Unit上
     /// </summary>
-    public class PathfindingComponent: Entity
+    public class PathfindingComponent: Entity, IAwake<string>, IDestroy
     {
         public static int FindRandomNavPosMaxRadius = 15000;  // 随机找寻路点的最大半径
         

+ 1 - 1
Unity/Codes/Model/Module/UnityWebRequest/UnityWebRequestAsync.cs

@@ -12,7 +12,7 @@ namespace ET
 		}
 	}
 	
-	public class UnityWebRequestAsync : Entity
+	public class UnityWebRequestAsync : Entity, IUpdate
 	{
 		public static AcceptAllCertificate certificateHandler = new AcceptAllCertificate();
 		

+ 1 - 1
Unity/Codes/Model/Module/UnityWebRequest/UnityWebRequestRenewalAsync.cs

@@ -17,7 +17,7 @@ namespace ET
     /// <summary>
     /// 断点续传实现
     /// </summary>
-    public class UnityWebRequestRenewalAsync: Entity
+    public class UnityWebRequestRenewalAsync: Entity, IUpdate
     {
         public static AcceptAllCertificate certificateHandler = new AcceptAllCertificate();
 

+ 1 - 1
Unity/Codes/ModelView/Demo/Camera/CameraComponent.cs

@@ -20,7 +20,7 @@ namespace ET
 		}
 	}
 
-	public class CameraComponent : Entity
+	public class CameraComponent : Entity, IAwake, ILateUpdate
 	{
 		// 战斗摄像机
 		public Camera mainCamera;

+ 1 - 1
Unity/Codes/ModelView/Demo/Global/GlobalComponent.cs

@@ -2,7 +2,7 @@ using UnityEngine;
 
 namespace ET
 {
-    public class GlobalComponent: Entity
+    public class GlobalComponent: Entity, IAwake
     {
         public static GlobalComponent Instance;
         

+ 1 - 1
Unity/Codes/ModelView/Demo/Opera/OperaComponent.cs

@@ -4,7 +4,7 @@ using UnityEngine;
 
 namespace ET
 {
-	public class OperaComponent: Entity
+	public class OperaComponent: Entity, IAwake, IUpdate
     {
         public Vector3 ClickPoint;
 

+ 2 - 2
Unity/Codes/ModelView/Demo/Resource/ResourcesComponent.cs

@@ -33,7 +33,7 @@ namespace ET
         }
     }
 
-    public class ABInfo: Entity
+    public class ABInfo: Entity, IAwake<string, AssetBundle>, IDestroy
     {
         public string Name { get; set; }
 
@@ -127,7 +127,7 @@ namespace ET
         }
     }
 
-    public class ResourcesComponent: Entity
+    public class ResourcesComponent: Entity, IAwake
     {
         public static ResourcesComponent Instance { get; set; }
 

+ 1 - 1
Unity/Codes/ModelView/Demo/Resource/ResourcesLoaderComponent.cs

@@ -45,7 +45,7 @@ namespace ET
         }
     }
 
-    public class ResourcesLoaderComponent: Entity
+    public class ResourcesLoaderComponent: Entity, IAwake, IDestroy
     {
         public HashSet<string> LoadedResource = new HashSet<string>();
 

+ 1 - 1
Unity/Codes/ModelView/Demo/Scene/SceneChangeComponent.cs

@@ -2,7 +2,7 @@
 
 namespace ET
 {
-    public class SceneChangeComponent: Entity
+    public class SceneChangeComponent: Entity, IAwake, IUpdate, IDestroy
     {
         public AsyncOperation loadMapOperation;
         public ETTask tcs;

+ 1 - 1
Unity/Codes/ModelView/Demo/UI/UILoading/UILoadingComponent.cs

@@ -3,7 +3,7 @@ using UnityEngine.UI;
 
 namespace ET
 {
-	public class UILoadingComponent : Entity
+	public class UILoadingComponent : Entity, IAwake
 	{
 		public Text text;
 	}

+ 1 - 1
Unity/Codes/ModelView/Demo/UI/UILobby/UILobbyComponent.cs

@@ -4,7 +4,7 @@ using UnityEngine.UI;
 
 namespace ET
 {
-	public class UILobbyComponent : Entity
+	public class UILobbyComponent : Entity, IAwake
 	{
 		public GameObject enterMap;
 		public Text text;

+ 1 - 1
Unity/Codes/ModelView/Demo/UI/UILogin/UILoginComponent.cs

@@ -6,7 +6,7 @@ using UnityEngine.UI;
 
 namespace ET
 {
-	public class UILoginComponent: Entity
+	public class UILoginComponent: Entity, IAwake
 	{
 		public GameObject account;
 		public GameObject password;

+ 1 - 1
Unity/Codes/ModelView/Demo/Unit/AnimatorComponent.cs

@@ -10,7 +10,7 @@ namespace ET
 		Run,
 	}
 
-	public class AnimatorComponent : Entity
+	public class AnimatorComponent : Entity, IAwake, IUpdate, IDestroy
 	{
 		public Dictionary<string, AnimationClip> animationClips = new Dictionary<string, AnimationClip>();
 		public HashSet<string> Parameter = new HashSet<string>();

+ 1 - 1
Unity/Codes/ModelView/Demo/Unit/GameObjectComponent.cs

@@ -2,7 +2,7 @@ using UnityEngine;
 
 namespace ET
 {
-    public class GameObjectComponent: Entity
+    public class GameObjectComponent: Entity, IAwake, IDestroy
     {
         public GameObject GameObject;
     }

+ 1 - 1
Unity/Codes/ModelView/Module/UI/UI.cs

@@ -14,7 +14,7 @@ namespace ET
 		}
 	}
 	
-	public sealed class UI: Entity
+	public sealed class UI: Entity, IAwake<string, GameObject>
 	{
 		public GameObject GameObject;
 		

+ 1 - 1
Unity/Codes/ModelView/Module/UI/UIComponent.cs

@@ -5,7 +5,7 @@ namespace ET
 	/// <summary>
 	/// 管理Scene上的UI
 	/// </summary>
-	public class UIComponent: Entity
+	public class UIComponent: Entity, IAwake
 	{
 		public Dictionary<string, UI> UIs = new Dictionary<string, UI>();
 	}

+ 1 - 1
Unity/Codes/ModelView/Module/UI/UIEventComponent.cs

@@ -7,7 +7,7 @@ namespace ET
 	/// <summary>
 	/// 管理所有UI GameObject
 	/// </summary>
-	public class UIEventComponent: Entity
+	public class UIEventComponent: Entity, IAwake
 	{
 		public static UIEventComponent Instance;