2025-06-07 17:43:34 +08:00

64 lines
2.1 KiB
C#

using Cysharp.Threading.Tasks;
using System.Collections;
using System.Runtime.CompilerServices;
using System.Threading.Tasks;
using UnityEngine;
public static class Framework
{
internal static GameObject console;
/// <summary>
/// UI
/// </summary>
public static UIManager uiMgr { get; private set; } = new UIManager();
public static FairyGuiManager fguiMgr { get; private set; } = new FairyGuiManager();
public static ResManager res { get; private set; } = new ResManager();
/// <summary>
/// socket
/// </summary>
public static NetworkManager network { get; private set; } = new NetworkManager();
public static MessageManager message { get; private set; } = new MessageManager();
public static StorageManager storage { get; private set; } = new StorageManager();
public static AudioManager audioManager { get; private set; } = new AudioManager();
public static DeviceInfoManager device { get; private set; } = new DeviceInfoManager();
/// <summary>
/// Http
/// </summary>
public static HttpRequestManager httpRequest { get; private set; } = new HttpRequestManager();
public static LogManager logMgr { get; private set; } = new LogManager();
public static UpdateController updateController { get; set; }
// public static UI_VersionUpdate ui_versionUpdate;
public static async UniTask Init(GameObject ga, GameObject console)
{
Debug.Log("初始化");
Framework.console = console;
//Object.DontDestroyOnLoad(ga);
updateController = ga.AddComponent<UpdateController>();
await res.Init();
uiMgr.Init(GameObject.Find("Gui/Canvas").GetComponent<Canvas>(), GameObject.Find("Gui/Camera").GetComponent<Camera>());
//await fguiMgr.Init();
// ui_versionUpdate = Framework.uiMgr.SetPanel<UI_VersionUpdate>(uiMgr.uiRoot.parent.Find("UI_VersionUpdate"));
await UITool.Init();
//network.Init();
// await rpcNetWorkMgr.Init();
device.InitDeviceInfo();
}
}