Please disclose if any significant portion of your mod was created using AI tools by adding the 'AI Generated' category. Failing to do so may result in the mod being removed from Thunderstore.
Decompiled source of DesaSounds2 v1.0.8
DesaSounds.dll
Decompiled 3 months agousing System; using System.Collections.Generic; 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.Logging; using HarmonyLib; using Microsoft.CodeAnalysis; using ModsCacones.Patches; using Photon.Pun; using UnityEngine; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: IgnoresAccessChecksTo("")] [assembly: AssemblyCompany("Desay1")] [assembly: AssemblyConfiguration("Debug")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0+35d97dd94ea9046eb224450dfceacec0ab125f28")] [assembly: AssemblyProduct("DesaSounds")] [assembly: AssemblyTitle("DesaSounds")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.0.0.0")] [module: UnverifiableCode] [module: RefSafetyRules(11)] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] [AttributeUsage(AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)] internal sealed class NullableAttribute : Attribute { public readonly byte[] NullableFlags; public NullableAttribute(byte P_0) { NullableFlags = new byte[1] { P_0 }; } public NullableAttribute(byte[] P_0) { NullableFlags = P_0; } } [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Interface | AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)] internal sealed class NullableContextAttribute : Attribute { public readonly byte Flag; public NullableContextAttribute(byte P_0) { Flag = P_0; } } [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] [AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)] internal sealed class RefSafetyRulesAttribute : Attribute { public readonly int Version; public RefSafetyRulesAttribute(int P_0) { Version = P_0; } } } public static class EnemyDuckExtension { private static readonly ConditionalWeakTable<EnemyDuck, EnemyDuckData> data = new ConditionalWeakTable<EnemyDuck, EnemyDuckData>(); public static EnemyDuckData GetDuckData(this EnemyDuck instance) { return data.GetOrCreateValue(instance); } } public static class EnemyTickExtension { private static readonly ConditionalWeakTable<EnemyTick, EnemyTickData> data = new ConditionalWeakTable<EnemyTick, EnemyTickData>(); public static EnemyTickData GetTickData(this EnemyTick instance) { return data.GetOrCreateValue(instance); } } namespace ModsCacones.Patches { [HarmonyPatch(typeof(EnemyBombThrowerHead))] public class EnemyBombHeadPatch { [HarmonyPatch("Awake")] [HarmonyPrefix] private static void AwakePatch(EnemyBombThrowerHead __instance) { AudioSource val = ((Component)__instance).gameObject.GetComponent<AudioSource>() ?? ((Component)__instance).gameObject.AddComponent<AudioSource>(); val.dopplerLevel = 0f; val.spatialBlend = 0f; val.maxDistance = 800f; __instance.soundLaugh.Source = val; __instance.soundLaugh.Doppler = 0f; __instance.soundLaugh.LoopFalloffMax = 800f; } [HarmonyPatch("SoundLoopLogic")] [HarmonyPrefix] private static bool SoundLoopLogicPatch(EnemyBombThrowerHead __instance) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Invalid comparison between Unknown and I4 __instance.soundLaugh.PlayLoop((int)__instance.currentState == 2, 1f, 1f, 1f); return false; } [HarmonyPatch("StateActive")] [HarmonyPrefix] private static void StateActivePatch(EnemyBombThrowerHead __instance) { if (__instance.stateImpulse) { __instance.stateTimer = 7.5f; } } } [HarmonyPatch(typeof(EnemyDuck))] public class EnemyDuckPatch { public static List<AudioClip> AngryClips = new List<AudioClip>(); public static List<AudioClip> DestranClips = new List<AudioClip>(); public static List<AudioClip> ValRotoClips = new List<AudioClip>(); public static List<AudioClip> StunClips = new List<AudioClip>(); public static List<AudioClip> CachadoClips = new List<AudioClip>(); public static List<AudioClip> AtrapadoClips = new List<AudioClip>(); public static List<AudioClip> LibertadClips = new List<AudioClip>(); [HarmonyPatch("Awake")] [HarmonyPrefix] private static void AwakePatch(EnemyDuck __instance) { if (PhotonNetwork.IsConnected) { PhotonView val = ((Component)__instance).gameObject.GetComponent<PhotonView>() ?? ((Component)__instance).gameObject.AddComponent<PhotonView>(); mySync orSetSync_Duck = myHelper.GetOrSetSync_Duck(__instance); } } [HarmonyPatch("StateAttackStart")] [HarmonyPrefix] private static void GritoEnojo(EnemyDuck __instance) { if (SemiFunc.IsMasterClientOrSingleplayer() && __instance.stateImpulse) { __instance.GetDuckData().angry = true; mySync orSetSync_Duck = myHelper.GetOrSetSync_Duck(__instance); orSetSync_Duck.SyncSound("duck", "angry", myHelper.GetRandomSound(AngryClips)); } } [HarmonyPatch("StateDeTransform")] [HarmonyPostfix] private static void GritoDestr(EnemyDuck __instance) { if (SemiFunc.IsMasterClientOrSingleplayer() && __instance.stateTimer <= 0f) { __instance.GetDuckData().angry = false; mySync orSetSync_Duck = myHelper.GetOrSetSync_Duck(__instance); orSetSync_Duck.SyncSound("duck", "calm", myHelper.GetRandomSound(DestranClips)); } } [HarmonyPatch("StateStun")] [HarmonyPostfix] private static void Stuneado(EnemyDuck __instance) { if (SemiFunc.IsMasterClientOrSingleplayer() && __instance.enemy.IsStunned() && ((__instance.enemy.StateStunned.stunTimer >= 6f && __instance.enemy.StateStunned.stunTimer <= 7f) || (__instance.enemy.StateStunned.stunTimer >= 12f && __instance.enemy.StateStunned.stunTimer <= 13f))) { mySync orSetSync_Duck = myHelper.GetOrSetSync_Duck(__instance); orSetSync_Duck.SyncSound("duck", "stun", myHelper.GetRandomSound(StunClips)); } } [HarmonyPatch("DuckBucketLogic")] [HarmonyPostfix] private static void Bucket(EnemyDuck __instance) { if (!SemiFunc.IsMasterClientOrSingleplayer()) { return; } if (__instance.duckBucketActive) { if (__instance.GetDuckData().trapped == 0) { mySync orSetSync_Duck = myHelper.GetOrSetSync_Duck(__instance); orSetSync_Duck.SyncSound("duck", "cachado", myHelper.GetRandomSound(CachadoClips)); __instance.GetDuckData().trapped = 1; } else if (__instance.GetDuckData().trapped >= 550) { mySync orSetSync_Duck2 = myHelper.GetOrSetSync_Duck(__instance); orSetSync_Duck2.SyncSound("duck", "atrapado", myHelper.GetRandomSound(AtrapadoClips)); __instance.GetDuckData().trapped = 1; } else { __instance.GetDuckData().trapped++; } } else if (__instance.GetDuckData().trapped > 0) { mySync orSetSync_Duck3 = myHelper.GetOrSetSync_Duck(__instance); orSetSync_Duck3.SyncSound("duck", "libertad", myHelper.GetRandomSound(LibertadClips)); __instance.GetDuckData().trapped = 0; } } } [HarmonyPatch(typeof(EnemyHunter))] public class EnemyHunterPatch { [HarmonyPatch(typeof(EnemyHunter), "ShootRPC")] public static class EnemyScript_ShootRPC_Patch { private static void Postfix(Vector3 _hitPosition, EnemyHunter __instance) { //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Unknown result type (might be due to invalid IL or missing references) if (!SemiFunc.IsMasterClientOrSingleplayer()) { return; } float num = 0.1f; LayerMask val = LayerMask.op_Implicit(LayerMask.op_Implicit(SemiFunc.LayerMaskGetPhysGrabObject()) + LayerMask.GetMask(new string[1] { "Player" }) + LayerMask.GetMask(new string[1] { "Default" }) + LayerMask.GetMask(new string[1] { "Enemy" })); Collider[] array = Physics.OverlapSphere(_hitPosition, num, LayerMask.op_Implicit(val)); Collider[] array2 = array; foreach (Collider val2 in array2) { PlayerController componentInParent = ((Component)val2).GetComponentInParent<PlayerController>(); if ((Object)(object)componentInParent != (Object)null) { if (componentInParent.playerName == "Chapita") { PlayRandomLine(__instance, "chapita"); } else if (componentInParent.playerName == "Trickap") { PlayRandomLine(__instance, "joker"); } else { PlayRandomLine(__instance, "player"); } break; } PlayerTumble componentInParent2 = ((Component)val2).GetComponentInParent<PlayerTumble>(); if ((Object)(object)componentInParent2 != (Object)null) { PlayRandomLine(__instance, "player"); break; } EnemyRigidbody componentInParent3 = ((Component)val2).GetComponentInParent<EnemyRigidbody>(); if ((Object)(object)componentInParent3 != (Object)null) { PlayRandomLine(__instance, "player"); break; } PlayRandomLine(__instance, "miss"); } } } public static List<AudioClip> ClipsMiss = new List<AudioClip>(); public static List<AudioClip> ClipsHitPlayer = new List<AudioClip>(); public static List<AudioClip> ClipsHitChapita = new List<AudioClip>(); public static List<AudioClip> ClipsHitJoker = new List<AudioClip>(); [HarmonyPatch("Awake")] [HarmonyPrefix] private static void AwakePatch(EnemyHunter __instance) { if (PhotonNetwork.IsConnected) { PhotonView val = ((Component)__instance).gameObject.GetComponent<PhotonView>() ?? ((Component)__instance).gameObject.AddComponent<PhotonView>(); mySync orSetSync_Hunter = myHelper.GetOrSetSync_Hunter(__instance); } } private static void PlayRandomLine(EnemyHunter __instance, string hit) { if (SemiFunc.IsMasterClientOrSingleplayer()) { mySync orSetSync_Hunter = myHelper.GetOrSetSync_Hunter(__instance); switch (hit) { case "miss": orSetSync_Hunter.SyncSound("hunter", "miss", myHelper.GetRandomSound(ClipsMiss)); break; case "player": orSetSync_Hunter.SyncSound("hunter", "hit", myHelper.GetRandomSound(ClipsHitPlayer)); break; case "chapita": orSetSync_Hunter.SyncSound("hunter", "chapas", myHelper.GetRandomSound(ClipsHitChapita)); break; case "joker": orSetSync_Hunter.SyncSound("hunter", "joker", myHelper.GetRandomSound(ClipsHitJoker)); break; } } } } [HarmonyPatch(typeof(EnemyTick))] public class EnemyTickPatch { public static List<AudioClip> AtaqueClips = new List<AudioClip>(); public static List<AudioClip> IrseClips = new List<AudioClip>(); public static List<AudioClip> DeadClips = new List<AudioClip>(); [HarmonyPatch("Awake")] [HarmonyPrefix] private static void AwakePatch(EnemyTick __instance) { if (PhotonNetwork.IsConnected) { PhotonView val = ((Component)__instance).gameObject.GetComponent<PhotonView>() ?? ((Component)__instance).gameObject.AddComponent<PhotonView>(); mySync orSetSync_Tick = myHelper.GetOrSetSync_Tick(__instance); } } [HarmonyPatch("Suck")] [HarmonyPostfix] private static void Ataque(EnemyTick __instance) { if (SemiFunc.IsMasterClientOrSingleplayer() && !__instance.GetTickData().bite) { __instance.GetTickData().bite = true; mySync orSetSync_Tick = myHelper.GetOrSetSync_Tick(__instance); orSetSync_Tick.SyncSound("tick", "ataque", myHelper.GetRandomSound(AtaqueClips)); } } [HarmonyPatch("StateRunAway")] [HarmonyPostfix] private static void Huida(EnemyTick __instance) { if (SemiFunc.IsMasterClientOrSingleplayer() && __instance.GetTickData().bite) { __instance.GetTickData().bite = false; mySync orSetSync_Tick = myHelper.GetOrSetSync_Tick(__instance); orSetSync_Tick.SyncSound("tick", "irse", myHelper.GetRandomSound(IrseClips)); } } [HarmonyPatch("OnDeath")] [HarmonyPrefix] private static void Muerto(EnemyTick __instance) { if (SemiFunc.IsMasterClientOrSingleplayer()) { mySync orSetSync_Tick = myHelper.GetOrSetSync_Tick(__instance); orSetSync_Tick.SyncSound("tick", "dead", myHelper.GetRandomSound(DeadClips)); } } } [HarmonyPatch(typeof(PhysGrabObjectImpactDetector))] internal class PhysGrabObjectImpactDetectorPatch { [HarmonyPatch("DestroyObject")] [HarmonyPrefix] private static void ValDestroyed(ValuableObject? ___valuableObject) { //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)___valuableObject == (Object)null || !SemiFunc.IsMasterClientOrSingleplayer()) { return; } LayerMask val = LayerMask.op_Implicit(LayerMask.GetMask(new string[1] { "PhysGrabObject" })); Collider[] array = Physics.OverlapSphere(((Component)___valuableObject).transform.position, 15f, LayerMask.op_Implicit(val)); Collider[] array2 = array; foreach (Collider val2 in array2) { EnemyParent componentInParent = ((Component)val2).GetComponentInParent<EnemyParent>(); if (!((Object)(object)componentInParent != (Object)null) || !(((Object)componentInParent).name == "Enemy - Duck(Clone)")) { continue; } EnemyDuck componentInParent2 = ((Component)componentInParent.Enemy).GetComponentInParent<EnemyDuck>(); if ((Object)(object)componentInParent2 == (Object)null) { break; } if (!componentInParent2.enemy.IsStunned() & !componentInParent2.GetDuckData().angry) { mySync component = ((Component)componentInParent2).GetComponent<mySync>(); if ((Object)(object)component != (Object)null) { component.SyncSound("duck", "roto", myHelper.GetRandomSound(EnemyDuckPatch.ValRotoClips)); } } } } } public class EnemyDuckData { public bool angry = false; public int trapped = 0; } public class EnemyTickData { public bool bite = false; } public static class myHelper { public static int GetRandomSound(List<AudioClip> clipsList) { if (clipsList == null || clipsList.Count == 0) { return -1; } return Random.Range(0, clipsList.Count); } public static AudioSource GetOrSetEnemyAS_Hunter(EnemyHunter instance) { AudioSource val = ((Component)instance).GetComponent<AudioSource>(); if ((Object)(object)val == (Object)null) { val = ((Component)instance).gameObject.AddComponent<AudioSource>(); val.spatialBlend = 1f; val.maxDistance = 1000f; val.dopplerLevel = 0f; } return val; } public static AudioSource GetOrSetEnemyAS_Duck(EnemyDuck instance) { AudioSource val = ((Component)instance).GetComponent<AudioSource>(); if ((Object)(object)val == (Object)null) { val = ((Component)instance).gameObject.AddComponent<AudioSource>(); val.spatialBlend = 1f; val.maxDistance = 800f; val.dopplerLevel = 0f; } return val; } public static AudioSource GetOrSetEnemyAS_Tick(EnemyTick instance) { AudioSource val = ((Component)instance).GetComponent<AudioSource>(); if ((Object)(object)val == (Object)null) { val = ((Component)instance).gameObject.AddComponent<AudioSource>(); val.spatialBlend = 1f; val.maxDistance = 800f; val.dopplerLevel = 0f; } return val; } public static mySync GetOrSetSync_Hunter(EnemyHunter __instance) { mySync mySync2 = ((Component)__instance).GetComponent<mySync>(); if ((Object)(object)mySync2 == (Object)null) { mySync2 = ((Component)__instance).gameObject.AddComponent<mySync>(); mySync2.hunter = __instance; } return mySync2; } public static mySync GetOrSetSync_Duck(EnemyDuck __instance) { mySync mySync2 = ((Component)__instance).GetComponent<mySync>(); if ((Object)(object)mySync2 == (Object)null) { mySync2 = ((Component)__instance).gameObject.AddComponent<mySync>(); mySync2.duck = __instance; } return mySync2; } public static mySync GetOrSetSync_Tick(EnemyTick __instance) { mySync mySync2 = ((Component)__instance).GetComponent<mySync>(); if ((Object)(object)mySync2 == (Object)null) { mySync2 = ((Component)__instance).gameObject.AddComponent<mySync>(); mySync2.tick = __instance; } return mySync2; } } public class mySync : MonoBehaviourPun { public EnemyDuck? duck; public EnemyHunter? hunter; public EnemyTick? tick; private AudioSource audioSource; public void SyncSound(string enemy, string list, int clip) { ((MonoBehaviourPun)this).photonView.RPC("PlaySoundRPC", (RpcTarget)0, new object[3] { enemy, list, clip }); } [PunRPC] public void PlaySoundRPC(string enemy, string list, int clip) { //IL_04f0: Unknown result type (might be due to invalid IL or missing references) if (clip == -1) { return; } switch (enemy) { case "duck": if ((Object)(object)duck != (Object)null) { audioSource = myHelper.GetOrSetEnemyAS_Duck(duck); } switch (list) { case "angry": if (!audioSource.isPlaying) { audioSource.PlayOneShot(EnemyDuckPatch.AngryClips[clip]); } break; case "calm": if (!audioSource.isPlaying) { audioSource.PlayOneShot(EnemyDuckPatch.DestranClips[clip]); } break; case "roto": if (!audioSource.isPlaying) { audioSource.PlayOneShot(EnemyDuckPatch.ValRotoClips[clip]); } break; case "stun": if (!audioSource.isPlaying) { audioSource.PlayOneShot(EnemyDuckPatch.StunClips[clip]); } break; case "cachado": if (!audioSource.isPlaying) { audioSource.PlayOneShot(EnemyDuckPatch.CachadoClips[clip]); } break; case "atrapado": if (!audioSource.isPlaying) { audioSource.PlayOneShot(EnemyDuckPatch.AtrapadoClips[clip]); } break; case "libertad": if (!audioSource.isPlaying) { audioSource.PlayOneShot(EnemyDuckPatch.LibertadClips[clip]); } break; } break; case "hunter": if ((Object)(object)hunter != (Object)null) { audioSource = myHelper.GetOrSetEnemyAS_Hunter(hunter); } switch (list) { case "miss": if (!audioSource.isPlaying) { audioSource.PlayOneShot(EnemyHunterPatch.ClipsMiss[clip]); } break; case "hit": if (!audioSource.isPlaying) { audioSource.PlayOneShot(EnemyHunterPatch.ClipsHitPlayer[clip]); } break; case "chapas": if (!audioSource.isPlaying) { audioSource.PlayOneShot(EnemyHunterPatch.ClipsHitChapita[clip]); } break; case "joker": if (!audioSource.isPlaying) { audioSource.PlayOneShot(EnemyHunterPatch.ClipsHitJoker[clip]); } break; } break; case "tick": if ((Object)(object)tick != (Object)null) { audioSource = myHelper.GetOrSetEnemyAS_Tick(tick); } switch (list) { case "ataque": if (!audioSource.isPlaying) { audioSource.PlayOneShot(EnemyTickPatch.AtaqueClips[clip]); } break; case "irse": if (!audioSource.isPlaying) { audioSource.PlayOneShot(EnemyTickPatch.IrseClips[clip]); } break; case "dead": if (!audioSource.isPlaying) { audioSource.Stop(); } AudioSource.PlayClipAtPoint(EnemyTickPatch.DeadClips[clip], ((Component)audioSource).transform.position); break; } break; } } } } namespace DesaSounds { [BepInPlugin("Desay1.DesaSounds", "DesaSounds", "1.0")] public class DesaSounds : BaseUnityPlugin { private static string modFolder = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); internal static DesaSounds Instance { get; private set; } = null; internal static ManualLogSource Logger => Instance._logger; private ManualLogSource _logger => ((BaseUnityPlugin)this).Logger; internal Harmony? Harmony { get; set; } private void Awake() { Instance = this; ((Component)this).gameObject.transform.parent = null; ((Object)((Component)this).gameObject).hideFlags = (HideFlags)61; LoadSounds("snipermissbundle", EnemyHunterPatch.ClipsMiss); LoadSounds("sniperhitbundle", EnemyHunterPatch.ClipsHitPlayer); LoadSounds("sniperchapas", EnemyHunterPatch.ClipsHitChapita); LoadSounds("sniperjoker", EnemyHunterPatch.ClipsHitJoker); LoadSounds("demoangry", EnemyDuckPatch.AngryClips); LoadSounds("democalm", EnemyDuckPatch.DestranClips); LoadSounds("demoroto", EnemyDuckPatch.ValRotoClips); LoadSounds("demostun", EnemyDuckPatch.StunClips); LoadSounds("democachado", EnemyDuckPatch.CachadoClips); LoadSounds("demoatrapado", EnemyDuckPatch.AtrapadoClips); LoadSounds("demolibertad", EnemyDuckPatch.LibertadClips); LoadSounds("pulgaAtaque", EnemyTickPatch.AtaqueClips); LoadSounds("pulgaIrse", EnemyTickPatch.IrseClips); LoadSounds("pulgaDead", EnemyTickPatch.DeadClips); Patch(); Logger.LogInfo((object)$"{((BaseUnityPlugin)this).Info.Metadata.GUID} v{((BaseUnityPlugin)this).Info.Metadata.Version} has loaded!"); } private void LoadSounds(string bundleName, List<AudioClip> loadedClips) { string text = Path.Combine(modFolder, bundleName); AssetBundle val = AssetBundle.LoadFromFile(text); if ((Object)(object)val == (Object)null) { return; } AudioClip[] array = val.LoadAllAssets<AudioClip>(); if (array.Length != 0) { AudioClip[] array2 = array; foreach (AudioClip item in array2) { loadedClips.Add(item); } } } internal void Patch() { //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Expected O, but got Unknown //IL_0026: Expected O, but got Unknown if (Harmony == null) { Harmony val = new Harmony(((BaseUnityPlugin)this).Info.Metadata.GUID); Harmony val2 = val; Harmony = val; } Harmony.PatchAll(); } internal void Unpatch() { Harmony? harmony = Harmony; if (harmony != null) { harmony.UnpatchSelf(); } } private void Update() { } } [HarmonyPatch(typeof(PlayerController))] internal static class ExamplePlayerControllerPatch { [HarmonyPrefix] [HarmonyPatch("Start")] private static void Start_Prefix(PlayerController __instance) { DesaSounds.Logger.LogDebug((object)$"{__instance} Start Prefix"); } [HarmonyPostfix] [HarmonyPatch("Start")] private static void Start_Postfix(PlayerController __instance) { DesaSounds.Logger.LogDebug((object)$"{__instance} Start Postfix"); } } }