bepinex thing idk
This commit is contained in:
parent
ee41cfd777
commit
ee1a0ec8e1
3 changed files with 16 additions and 15 deletions
|
|
@ -150,24 +150,25 @@ namespace PvZ_Fusion_Translator__BepInEx_
|
|||
}
|
||||
#endif
|
||||
|
||||
[HarmonyPatch(typeof(UnityEngine.AudioSource), "Play", [])]
|
||||
[HarmonyPatch(typeof(AudioSource), "Play", [])]
|
||||
public class AudioSource_Patch
|
||||
{
|
||||
public static void Prefix(UnityEngine.AudioSource __instance)
|
||||
public static void Prefix(AudioSource __instance)
|
||||
{
|
||||
if(Utils.customAudio)
|
||||
{
|
||||
if (__instance.clip == null)
|
||||
return;
|
||||
if (Utils.customAudio)
|
||||
{
|
||||
if (__instance.clip == null)
|
||||
return;
|
||||
|
||||
string audioClipName = __instance.clip.name;
|
||||
string audioClipName = overrideEnabled ? "REPLACE_ALL" : __instance.clip.name;
|
||||
|
||||
if (AudioStore.AudioClips.TryGetValue(audioClipName, out AudioClip replaceClip))
|
||||
{
|
||||
__instance.pitch = 1;
|
||||
__instance.clip = replaceClip;
|
||||
}
|
||||
}
|
||||
if (AudioClips.TryGetValue(audioClipName, out AudioClip replaceClip))
|
||||
{
|
||||
__instance.pitch = 1;
|
||||
|
||||
__instance.clip = replaceClip;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -232,7 +232,7 @@ namespace PvZ_Fusion_Translator__BepInEx_.Patches.GameObjects.ButtonObjects
|
|||
}
|
||||
child.gameObject.SetActive(true);
|
||||
|
||||
Task.Delay(1000).ContinueWith(_ =>
|
||||
System.Threading.Tasks.Task.Delay(1000).ContinueWith(_ =>
|
||||
{
|
||||
if (button != null && child != null && child.gameObject.activeSelf)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@
|
|||
https://nuget.samboy.dev/v3/index.json
|
||||
</RestoreAdditionalProjectSources>
|
||||
<RootNamespace>PvZ_Fusion_Translator__BepInEx_</RootNamespace>
|
||||
<GamePath>C:\Users\rainb\Desktop\PC_PVZ-Fusion_2.8.2-BepInEx</GamePath>
|
||||
<GamePath>C:\Users\rainb\Desktop\PC_PVZ-Fusion_3.0.1-BepInEx</GamePath>
|
||||
<Configurations>Debug;DebugEnglish;ReleaseMulti;ReleaseEnglish;DebugTesting;ReleaseOther;DebugObfuscate;ReleaseObfuscate;DebugMulti</Configurations>
|
||||
<Platforms>AnyCPU;x64</Platforms>
|
||||
</PropertyGroup>
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue