Fix build issues: csproj references, Unity modules, Harmony calls

- Fixed csproj to reference all Unity modules (Core, Audio, IMG, Input, TextRendering, UI)
- Fixed AudioMixerGUI namespace conflicts (GUI.Window vs UnityEngine.GUI.Window)
- Fixed Harmony UnpatchAll -> UnpatchSelf
- Removed duplicate AssemblyInfo.cs
- Build now succeeds and DLL deployed to BepInEx/plugins
This commit is contained in:
2026-03-22 13:59:39 -04:00
parent b589d39ccd
commit 4285ae5258
5 changed files with 52 additions and 100 deletions

View File

@@ -1,14 +1,12 @@
using System;
using System.Collections.Generic;
using UnityEngine;
using HarmonyLib;
namespace HomuraHimeAudioMod.GUI
{
public class AudioMixerGUI : MonoBehaviour
{
private static AudioMixerGUI instance;
public static AudioMixerGUI Instance => instance;
private bool isVisible = false;
private Vector2 scrollPosition;
private float margin = 10f;
@@ -18,6 +16,7 @@ namespace HomuraHimeAudioMod.GUI
private float lineHeight = 30f;
private float windowWidth = 380f;
private float windowHeight = 520f;
private Rect windowRect = new Rect(10, 10, 380, 520);
private string[] enemyCueNames = new string[]
{
@@ -40,34 +39,20 @@ namespace HomuraHimeAudioMod.GUI
"Player_Critical"
};
private Rect windowRect
private void Start()
{
get => new Rect(margin, margin, windowWidth, windowHeight);
}
private void Awake()
{
if (instance == null)
{
instance = this;
DontDestroyOnLoad(gameObject);
Plugin.Log.LogInfo("AudioMixerGUI initialized");
}
else
{
Destroy(gameObject);
}
Plugin.Log.LogInfo("AudioMixerGUI started");
}
private void Update()
{
if (Input.GetKeyDown(KeyCode.F1))
if (UnityEngine.Input.GetKeyDown(KeyCode.F1))
{
isVisible = !isVisible;
Plugin.Log.LogDebug($"Audio Mixer GUI: {(isVisible ? "VISIBLE" : "HIDDEN")}");
}
if (Input.GetKeyDown(KeyCode.F2))
if (UnityEngine.Input.GetKeyDown(KeyCode.F2))
{
isVisible = false;
}
@@ -77,44 +62,15 @@ namespace HomuraHimeAudioMod.GUI
{
if (!isVisible) return;
GUI.skin = CreateCustomSkin();
windowRect.x = Mathf.Clamp(windowRect.x, 0, Screen.width - windowWidth - 10);
windowRect.y = Mathf.Clamp(windowRect.y, 0, Screen.height - windowHeight - 10);
windowRect = GUI.Window(0, windowRect, DrawMainWindow, "HomuraHime Audio Mixer (F1: Toggle | F2: Close)");
}
private GUISkin CreateCustomSkin()
{
GUISkin skin = GUI.skin;
GUIStyle headerStyle = new GUIStyle(GUI.skin.label)
{
fontSize = 14,
fontStyle = FontStyle.Bold,
alignment = TextAnchor.MiddleCenter
};
GUIStyle sectionStyle = new GUIStyle(GUI.skin.label)
{
fontSize = 12,
fontStyle = FontStyle.Bold,
normal = { textColor = new Color(0.9f, 0.7f, 0.3f) }
};
GUIStyle buttonStyle = new GUIStyle(GUI.skin.button)
{
fontSize = 11,
fontStyle = FontStyle.Normal
};
return skin;
windowRect = UnityEngine.GUI.Window(0, windowRect, DrawMainWindow, "HomuraHime Audio Mixer (F1: Toggle | F2: Close)");
}
private void DrawMainWindow(int windowID)
{
GUI.DragWindow(new Rect(0, 0, windowWidth - 20, 25));
UnityEngine.GUI.DragWindow(new Rect(0, 0, windowWidth - 20, 25));
scrollPosition = GUILayout.BeginScrollView(scrollPosition);