ActorMessageDispatcherComponent.cs 836 B

123456789101112131415161718192021222324252627282930
  1. using System;
  2. using System.Collections.Generic;
  3. namespace ET.Server
  4. {
  5. public class ActorMessageDispatcherInfo
  6. {
  7. public SceneType SceneType { get; }
  8. public IMActorHandler IMActorHandler { get; }
  9. public ActorMessageDispatcherInfo(SceneType sceneType, IMActorHandler imActorHandler)
  10. {
  11. this.SceneType = sceneType;
  12. this.IMActorHandler = imActorHandler;
  13. }
  14. }
  15. /// <summary>
  16. /// Actor消息分发组件
  17. /// </summary>
  18. [ComponentOf(typeof(Scene))]
  19. public class ActorMessageDispatcherComponent: Entity, IAwake, IDestroy, ILoad
  20. {
  21. [StaticField]
  22. public static ActorMessageDispatcherComponent Instance;
  23. public readonly Dictionary<Type, List<ActorMessageDispatcherInfo>> ActorMessageHandlers = new();
  24. }
  25. }