1
0
mirror of https://github.com/soarqin/DSP_Mods_TO.git synced 2025-12-12 01:23:31 +08:00
Files
DSP_Mods_TO/XianTu/XianTuPlugin.cs
2024-05-03 00:28:53 +08:00

48 lines
1.1 KiB
C#

using AssetsLoader;
using BepInEx;
using BepInEx.Configuration;
using BepInEx.Logging;
using UnityEngine;
using XianTu.Scripts.DataController;
using XianTu.UI;
namespace XianTu
{
[BepInPlugin("me.GammaChineYov.plugin.Dyson.XianTu", "XianTu", "1.0.5")]
internal class XianTuPlugin : BaseUnityPlugin
{
private static KeyCode HotKey => _hotKey.Value;
private void Awake()
{
_logger = Logger;
_hotKey = Config.Bind("config", "HotKey", KeyCode.F2, "显示UI的快捷键");
var abload = ABLoader.LoadFromEmbeddedAssets("xiantu");
Singleton<LoadManager>.Instance.SetLoader(abload);
Singleton<LoadManager>.Instance.AddLoader(new EmbeddedFileLoad());
UIManager = new UIManager();
UIManager.SetActive(false);
UIManager.PanelManager.Push("BlueTuPatchUI");
new BlueTuController();
_logger.LogInfo("仙图加载完毕");
}
public UIManager UIManager { get; set; }
private void Update()
{
var keyDown = Input.GetKeyDown(HotKey);
if (keyDown)
{
UIManager.SetActive(!UIManager.ActiveSelf);
}
}
private static ManualLogSource _logger;
private static ConfigEntry<KeyCode> _hotKey;
}
}