File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -102,7 +102,6 @@ private void Update()
102102 HarmonyUtils . _init ( ) ;
103103 Harmony . CreateAndPatchAll ( typeof ( LM ) , Others . harmony_id ) ;
104104 Harmony . CreateAndPatchAll ( typeof ( ResourcesPatch ) , Others . harmony_id ) ;
105- Harmony . CreateAndPatchAll ( typeof ( FMODPatches ) , Others . harmony_id ) ;
106105 if ( ! SmoothLoader . isLoading ( ) ) SmoothLoader . prepare ( ) ;
107106
108107 SmoothLoader . add ( ( ) =>
Original file line number Diff line number Diff line change 1+ using System . Reflection ;
2+ using HarmonyLib ;
3+ using NeoModLoader . constants ;
4+
5+ namespace NeoModLoader . services ;
6+
7+ public static class DebugService
8+ {
9+ static void Debugger ( MethodBase __originalMethod )
10+ {
11+ LogService . LogInfo ( __originalMethod . ToString ( ) ) ;
12+ }
13+ static readonly Harmony Patcher = new Harmony ( Others . harmony_id ) ;
14+ private static readonly HarmonyMethod Hook = new ( AccessTools . Method ( typeof ( DebugService ) , nameof ( Debugger ) ) ) ;
15+ public static void AttachDebugger ( Assembly assembly )
16+ {
17+ foreach ( var Type in assembly . GetTypes ( ) )
18+ {
19+ foreach ( var method in Type . GetMethods (
20+ BindingFlags . Public |
21+ BindingFlags . NonPublic |
22+ BindingFlags . Instance |
23+ BindingFlags . Static |
24+ BindingFlags . DeclaredOnly ) )
25+ {
26+ Patcher . Patch ( method , Hook ) ;
27+ }
28+ }
29+ }
30+ public static void RemoveDebugger ( Assembly assembly )
31+ {
32+ foreach ( var Type in assembly . GetTypes ( ) )
33+ {
34+ foreach ( var method in Type . GetMethods (
35+ BindingFlags . Public |
36+ BindingFlags . NonPublic |
37+ BindingFlags . Instance |
38+ BindingFlags . Static |
39+ BindingFlags . DeclaredOnly ) )
40+ {
41+ Patcher . Unpatch ( method , HarmonyPatchType . Prefix ) ;
42+ }
43+ }
44+ }
45+ }
Original file line number Diff line number Diff line change 11using FMOD ;
22using FMODUnity ;
33using HarmonyLib ;
4+ using NeoModLoader . constants ;
45using UnityEngine ;
56
67namespace NeoModLoader . utils . Sounds ;
@@ -51,6 +52,7 @@ static void ClearAllCustomSounds()
5152 [ HarmonyPatch ( typeof ( RuntimeManager ) , "Update" ) ]
5253 static void Update ( )
5354 {
55+
5456 SFXGroup . setVolume ( GetVolume ( SoundType . Sound ) ) ;
5557 MusicGroup . setVolume ( GetVolume ( SoundType . Music ) ) ;
5658 UIGroup . setVolume ( GetVolume ( SoundType . UI ) ) ;
@@ -69,6 +71,7 @@ public static class FMODHelper
6971
7072 internal static void InitFMOD ( )
7173 {
74+ Harmony . CreateAndPatchAll ( typeof ( FMODPatches ) , Others . harmony_id ) ;
7275 ThrowIfNotOk ( "Failed to initialize FMOD Core System!" , RuntimeManager . StudioSystem . getCoreSystem ( out var coresystem ) ) ;
7376 FMODSystem = coresystem ;
7477 ThrowIfNotOk ( "Failed to create SFXGroup" , FMODSystem . createChannelGroup ( "SFXGroup" , out var Group ) ) ;
You can’t perform that action at this time.
0 commit comments