AppStart_Init.cs 1.0 KB

12345678910111213141516171819202122232425262728293031
  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. ResourcesComponent.Instance.LoadBundle("unit.unity3d");
  19. Scene zoneScene = await SceneFactory.CreateZoneScene(1, 1, "Game");
  20. await Game.EventSystem.Publish(new EventType.AppStartInitFinish() { ZoneScene = zoneScene });
  21. }
  22. }
  23. }