47 lines
1.2 KiB
C#
47 lines
1.2 KiB
C#
using ET.EventType;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
#if UNITY
|
|
using libx;
|
|
using UnityEngine;
|
|
#endif
|
|
|
|
namespace ET
|
|
{
|
|
public class AppStartEvent : AEvent<AppStart>
|
|
{
|
|
public override async ETTask Run(AppStart args)
|
|
{
|
|
#if UNITY
|
|
//!设置帧率
|
|
Application.targetFrameRate = Define.FrameRate;
|
|
#endif
|
|
|
|
Game.Scene.AddComponent<TimerComponent>();
|
|
Game.Scene.AddComponent<CoroutineLockComponent>();
|
|
Game.Scene.AddComponent<GlobalConfigComponent>();
|
|
|
|
Define.IsEditorMode = GlobalConfigComponent.Instance.GlobalProto.isEditorMode;
|
|
if (!Define.IsEditorMode)
|
|
{
|
|
//关闭日志
|
|
Game.Options.LogLevel = 4;
|
|
}
|
|
|
|
GameKeyComponent keyComponent = Game.Scene.AddComponent<GameKeyComponent>();
|
|
keyComponent.key = args.key;
|
|
keyComponent.keyIV = args.keyIV;
|
|
keyComponent.xorKey = args.xorKey;
|
|
|
|
|
|
#if UNITY
|
|
Game.Scene.AddComponent<Updater>();
|
|
#endif
|
|
|
|
|
|
await Game.EventSystem.Publish(new EventType.AppStartInitFinish() { });
|
|
|
|
await ETTask.CompletedTask;
|
|
}
|
|
}
|
|
} |