FiberInit_Main.cs 731 B

1234567891011121314151617
  1. namespace ET
  2. {
  3. [Invoke((long)SceneType.Main)]
  4. public class FiberInit_Main: AInvokeHandler<FiberInit, ETTask>
  5. {
  6. public override async ETTask Handle(FiberInit fiberInit)
  7. {
  8. Scene root = fiberInit.Fiber.Root;
  9. root.AddComponent<MailBoxComponent, MailBoxType>(MailBoxType.UnOrderedMessage);
  10. root.AddComponent<ActorSenderComponent>();
  11. root.AddComponent<ActorRecverComponent>();
  12. await EventSystem.Instance.PublishAsync(root, new EventType.EntryEvent1());
  13. await EventSystem.Instance.PublishAsync(root, new EventType.EntryEvent2());
  14. await EventSystem.Instance.PublishAsync(root, new EventType.EntryEvent3());
  15. }
  16. }
  17. }