|
@@ -4,18 +4,25 @@ using Il2Cpp;
|
|
|
using UnityEngine;
|
|
using UnityEngine;
|
|
|
using UnityEngine.Rendering;
|
|
using UnityEngine.Rendering;
|
|
|
|
|
|
|
|
|
|
+
|
|
|
namespace AudioMgr
|
|
namespace AudioMgr
|
|
|
{
|
|
{
|
|
|
public class AudioMain : MelonMod
|
|
public class AudioMain : MelonMod
|
|
|
{
|
|
{
|
|
|
bool initialized = false;
|
|
bool initialized = false;
|
|
|
- ClipManager myClipManager;
|
|
|
|
|
|
|
+ ClipManager myClipManager, myClipManager2;
|
|
|
Shot myPlayerShot;
|
|
Shot myPlayerShot;
|
|
|
|
|
+ string rootPath = Application.dataPath + "/../Mods/";
|
|
|
|
|
+ //AssetBundle bundle;
|
|
|
|
|
+ public static bool _debug = false;
|
|
|
|
|
|
|
|
public override void OnInitializeMelon()
|
|
public override void OnInitializeMelon()
|
|
|
{
|
|
{
|
|
|
ClassInjector.RegisterTypeInIl2Cpp<Shot>();
|
|
ClassInjector.RegisterTypeInIl2Cpp<Shot>();
|
|
|
ClassInjector.RegisterTypeInIl2Cpp<Queue>();
|
|
ClassInjector.RegisterTypeInIl2Cpp<Queue>();
|
|
|
|
|
+
|
|
|
|
|
+ AudioMgr.Settings.OnLoad();
|
|
|
|
|
+ //bundle = AssetBundle.LoadFromFile(Application.dataPath + "/../Mods/sillysounds.unity3d");
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
public override void OnSceneWasLoaded(int buildIndex, string sceneName)
|
|
public override void OnSceneWasLoaded(int buildIndex, string sceneName)
|
|
@@ -23,10 +30,17 @@ namespace AudioMgr
|
|
|
if (sceneName.Contains("Boot"))
|
|
if (sceneName.Contains("Boot"))
|
|
|
{
|
|
{
|
|
|
AudioMaster.CreateMasterParent();
|
|
AudioMaster.CreateMasterParent();
|
|
|
- myClipManager = new ClipManager();
|
|
|
|
|
|
|
+
|
|
|
|
|
+ //myClipManager = new ClipManager();
|
|
|
|
|
+ //myClipManager2 = new ClipManager();
|
|
|
|
|
+
|
|
|
|
|
+ //myClipManager.LoadClipFromFile("start", "start.mp3", ClipManager.LoadType.Decompressed);
|
|
|
|
|
+ //myClipManager.LoadClipFromFile("shutdown", "shutdown.mp3", ClipManager.LoadType.Decompressed);
|
|
|
|
|
+ //myClipManager.LoadClipFromFile("waterfall", "waterfall.ogg", ClipManager.LoadType.Decompressed);
|
|
|
|
|
+
|
|
|
|
|
+ //myClipManager2.LoadAllClipsFromBundle(bundle);
|
|
|
|
|
+
|
|
|
|
|
|
|
|
- myClipManager.LoadClipFromFile("start", "start.mp3", ClipManager.LoadType.Decompressed);
|
|
|
|
|
- myClipManager.LoadClipFromFile("shutdown", "shutdown.mp3", ClipManager.LoadType.Decompressed);
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
if (sceneName.Contains("Menu"))
|
|
if (sceneName.Contains("Menu"))
|
|
@@ -34,11 +48,11 @@ namespace AudioMgr
|
|
|
initialized = true;
|
|
initialized = true;
|
|
|
|
|
|
|
|
|
|
|
|
|
- myPlayerShot = AudioMaster.CreatePlayerShot(AudioMaster.SourceType.Ambience);
|
|
|
|
|
|
|
+ //myPlayerShot = AudioMaster.CreatePlayerShot(AudioMaster.SourceType.SFX);
|
|
|
|
|
|
|
|
|
|
|
|
|
- PatchMaster.AddReplacePatch("PLAY_SNDMECHDOORWOODOPEN1", myClipManager, "start", AudioMaster.SourceType.SFX);
|
|
|
|
|
- PatchMaster.AddReplacePatch("PLAY_SNDMECHDOORWOODCLOSE1", myClipManager, "shutdown", AudioMaster.SourceType.SFX);
|
|
|
|
|
|
|
+ //PatchMaster.AddReplacePatch("PLAY_CROWCAWSDISTANT", myClipManager, "start", AudioMaster.SourceType.SFX);
|
|
|
|
|
+ //PatchMaster.AddReplacePatch("PLAY_SNDMECHDOORWOODCLOSE1", myClipManager, "shutdown", AudioMaster.SourceType.SFX);
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
}
|
|
@@ -54,7 +68,7 @@ namespace AudioMgr
|
|
|
|
|
|
|
|
public override void OnUpdate()
|
|
public override void OnUpdate()
|
|
|
{
|
|
{
|
|
|
- /*
|
|
|
|
|
|
|
+
|
|
|
if (InputManager.GetKeyDown(InputManager.m_CurrentContext, KeyCode.Keypad0))
|
|
if (InputManager.GetKeyDown(InputManager.m_CurrentContext, KeyCode.Keypad0))
|
|
|
{
|
|
{
|
|
|
// myPlayerShot.PlayOneshot(myClipManager.GetClip("waterfall"));
|
|
// myPlayerShot.PlayOneshot(myClipManager.GetClip("waterfall"));
|
|
@@ -63,8 +77,12 @@ namespace AudioMgr
|
|
|
PatchMaster.AddParameterPatch("WINDACTUALSPEED", 0f, PatchMaster.ParameterType.Limitter);
|
|
PatchMaster.AddParameterPatch("WINDACTUALSPEED", 0f, PatchMaster.ParameterType.Limitter);
|
|
|
PatchMaster.AddParameterPatch("AMBIENTVOLUME", 0f, PatchMaster.ParameterType.Limitter);
|
|
PatchMaster.AddParameterPatch("AMBIENTVOLUME", 0f, PatchMaster.ParameterType.Limitter);
|
|
|
PatchMaster.AddParameterPatch("GLOBALVOLUME", 0f, PatchMaster.ParameterType.Limitter);
|
|
PatchMaster.AddParameterPatch("GLOBALVOLUME", 0f, PatchMaster.ParameterType.Limitter);
|
|
|
- }
|
|
|
|
|
- */
|
|
|
|
|
|
|
+ }
|
|
|
|
|
+ if (InputManager.GetKeyDown(InputManager.m_CurrentContext, KeyCode.L))
|
|
|
|
|
+ {
|
|
|
|
|
+ //myPlayerShot.PlayOneshot(myClipManager2.GetClip("woo"));
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
- }
|
|
|
|
|
}
|
|
}
|