2021-04-08 20:09:59 +08:00
|
|
|
|
using ET.EventType;
|
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
2021-04-20 00:25:04 +08:00
|
|
|
|
#if UNITY
|
|
|
|
|
using libx;
|
2021-04-08 20:09:59 +08:00
|
|
|
|
using UnityEngine;
|
2021-04-20 00:25:04 +08:00
|
|
|
|
#endif
|
2021-04-08 20:09:59 +08:00
|
|
|
|
|
|
|
|
|
namespace ET
|
|
|
|
|
{
|
|
|
|
|
public class AppStartEvent : AEvent<AppStart>
|
|
|
|
|
{
|
|
|
|
|
public override async ETTask Run(AppStart args)
|
|
|
|
|
{
|
2021-04-20 00:25:04 +08:00
|
|
|
|
#if UNITY
|
2021-04-08 20:09:59 +08:00
|
|
|
|
//!设置帧率
|
|
|
|
|
Application.targetFrameRate = Define.FrameRate;
|
2021-04-20 00:25:04 +08:00
|
|
|
|
#endif
|
2021-04-08 20:09:59 +08:00
|
|
|
|
|
|
|
|
|
Game.Scene.AddComponent<TimerComponent>();
|
|
|
|
|
Game.Scene.AddComponent<CoroutineLockComponent>();
|
|
|
|
|
Game.Scene.AddComponent<GlobalConfigComponent>();
|
|
|
|
|
|
|
|
|
|
Define.IsEditorMode = GlobalConfigComponent.Instance.GlobalProto.isEditorMode;
|
|
|
|
|
|
2021-04-11 19:50:39 +08:00
|
|
|
|
GameKeyComponent keyComponent = Game.Scene.AddComponent<GameKeyComponent>();
|
2021-04-08 20:09:59 +08:00
|
|
|
|
keyComponent.key = args.key;
|
|
|
|
|
keyComponent.keyIV = args.keyIV;
|
|
|
|
|
keyComponent.xorKey = args.xorKey;
|
|
|
|
|
|
|
|
|
|
|
2021-04-20 00:25:04 +08:00
|
|
|
|
#if UNITY
|
2021-04-08 20:09:59 +08:00
|
|
|
|
Game.Scene.AddComponent<Updater>();
|
2021-04-20 00:25:04 +08:00
|
|
|
|
#endif
|
2021-04-08 20:09:59 +08:00
|
|
|
|
|
|
|
|
|
|
2021-04-20 00:25:04 +08:00
|
|
|
|
await Game.EventSystem.Publish(new EventType.AppStartInitFinish() { });
|
2021-04-08 20:09:59 +08:00
|
|
|
|
|
|
|
|
|
await ETTask.CompletedTask;
|
|
|
|
|
}
|
|
|
|
|
}
|
2021-04-20 00:25:04 +08:00
|
|
|
|
}
|