AppStart_Init.cs 999 B

123456789101112131415161718192021222324252627282930
  1. namespace ET
  2. {
  3. public class AppStart_Init: AEvent<EventType.AppStart>
  4. {
  5. public override async ETTask Run(EventType.AppStart args)
  6. {
  7. Game.Scene.AddComponent<TimerComponent>();
  8. // 下载ab包
  9. //await BundleHelper.DownloadBundle("1111");
  10. // 加载配置
  11. Game.Scene.AddComponent<ResourcesComponent>();
  12. ResourcesComponent.Instance.LoadBundle("config.unity3d");
  13. Game.Scene.AddComponent<ConfigComponent>();
  14. ResourcesComponent.Instance.UnloadBundle("config.unity3d");
  15. Game.Scene.AddComponent<OpcodeTypeComponent>();
  16. Game.Scene.AddComponent<MessageDispatcherComponent>();
  17. Game.Scene.AddComponent<UIEventComponent>();
  18. Scene zoneScene = await SceneFactory.CreateZoneScene(1, 0, "Game");
  19. await Game.EventSystem.Publish(new EventType.AppStartInitFinish() { ZoneScene = zoneScene });
  20. }
  21. }
  22. }