| 12345678910111213141516171819202122232425 |
- using System;
- using System.Collections.Generic;
- using System.IO;
- namespace ET.Client
- {
- [Event(SceneType.Main)]
- public class EntryEvent3_InitClient: AEvent<Scene, EntryEvent3>
- {
- protected override async ETTask Run(Scene root, EntryEvent3 args)
- {
- GlobalComponent globalComponent = root.AddComponent<GlobalComponent>();
- root.AddComponent<UIGlobalComponent>();
- root.AddComponent<UIComponent>();
- root.AddComponent<ResourcesLoaderComponent>();
- root.AddComponent<PlayerComponent>();
- root.AddComponent<CurrentScenesComponent>();
-
- // 根据配置修改掉Main Fiber的SceneType
- int sceneType = SceneTypeSingleton.Instance.GetSceneType(globalComponent.GlobalConfig.SceneName);
- root.SceneType = sceneType;
- await EventSystem.Instance.PublishAsync(root, new AppStartInitFinish());
- }
- }
- }
|