using System.Diagnostics;
using System.IO;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using BepInEx.Configuration;
using UnityEngine;
using YAPYAP;
[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: IgnoresAccessChecksTo("Assembly-CSharp-firstpass")]
[assembly: IgnoresAccessChecksTo("Assembly-CSharp")]
[assembly: IgnoresAccessChecksTo("Unity.RenderPipelines.Universal.Runtime")]
[assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")]
[assembly: AssemblyCompany("MHZ")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyCopyright("Copyright © 2026 Masaicker")]
[assembly: AssemblyFileVersion("1.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("VoiceCommandReload")]
[assembly: AssemblyTitle("VoiceCommandReload")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
namespace VoiceCommandReload
{
[BepInPlugin("Mhz.voicecommandreload", "VoiceCommandReload", "1.0.1")]
public class Plugin : BaseUnityPlugin
{
private VoiceManager _voiceManager;
private ConfigEntry<KeyCode> _reloadKey;
private ConfigEntry<KeyCode> _openConfigKey;
public void Start()
{
//IL_0068: Unknown result type (might be due to invalid IL or missing references)
_reloadKey = ((BaseUnityPlugin)this).Config.Bind<KeyCode>("General", "Reload Key", (KeyCode)286, "按键 / Hotkey: 重载语音命令 / Reload voice commands");
_openConfigKey = ((BaseUnityPlugin)this).Config.Bind<KeyCode>("General", "Open Config Folder Key", (KeyCode)287, "按键 / Hotkey: 打开语音命令配置文件夹 / Open voice commands folder");
Service.Get<VoiceManager>(ref _voiceManager);
((BaseUnityPlugin)this).Logger.LogInfo((object)$"语音命令热加载已加载 - 按{_reloadKey.Value}重载");
}
public void Update()
{
//IL_0007: Unknown result type (might be due to invalid IL or missing references)
//IL_0040: Unknown result type (might be due to invalid IL or missing references)
if (Input.GetKeyDown(_reloadKey.Value))
{
VoiceManager voiceManager = _voiceManager;
if (voiceManager != null)
{
voiceManager.ReloadLocalisation();
}
((BaseUnityPlugin)this).Logger.LogInfo((object)"语音命令已重载");
}
if (Input.GetKeyDown(_openConfigKey.Value))
{
OpenFolder(Path.Combine(Application.streamingAssetsPath, "Vosk", "Localisation"));
((BaseUnityPlugin)this).Logger.LogInfo((object)"已打开语音命令配置文件夹");
}
}
private void OpenFolder(string path)
{
Application.OpenURL(Path.GetFullPath(path));
}
}
}
namespace System.Runtime.CompilerServices
{
[AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)]
internal sealed class IgnoresAccessChecksToAttribute : Attribute
{
public IgnoresAccessChecksToAttribute(string assemblyName)
{
}
}
}