ActorMessageDispatcherComponent.cs 774 B

12345678910111213141516171819202122232425262728
  1. using System;
  2. using System.Collections.Generic;
  3. namespace ET
  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. public class ActorMessageDispatcherComponent: Entity, IAwake, IDestroy, ILoad
  19. {
  20. public static ActorMessageDispatcherComponent Instance;
  21. public readonly Dictionary<Type, List<ActorMessageDispatcherInfo>> ActorMessageHandlers = new();
  22. }
  23. }