sprite fix (?)
This commit is contained in:
parent
d49fae11bb
commit
1f6ef36728
2 changed files with 29 additions and 0 deletions
28
MelonLoader/Patches/GameObjects/Board_Patch.cs
Normal file
28
MelonLoader/Patches/GameObjects/Board_Patch.cs
Normal file
|
|
@ -0,0 +1,28 @@
|
||||||
|
using HarmonyLib;
|
||||||
|
using Il2Cpp;
|
||||||
|
using Il2CppTMPro;
|
||||||
|
using PvZ_Fusion_Translator.AssetStore;
|
||||||
|
using UnityEngine;
|
||||||
|
|
||||||
|
namespace PvZ_Fusion_Translator.Patches.GameObjects
|
||||||
|
{
|
||||||
|
[HarmonyPatch(typeof(Board))]
|
||||||
|
public static class Board_Patch
|
||||||
|
{
|
||||||
|
[HarmonyPatch(nameof(Board.Update))]
|
||||||
|
[HarmonyPostfix]
|
||||||
|
private static void Update(Board __instance)
|
||||||
|
{
|
||||||
|
foreach (SpriteRenderer spriteRenderer in __instance.GetComponentsInChildren<SpriteRenderer>())
|
||||||
|
{
|
||||||
|
if (spriteRenderer.sprite != null)
|
||||||
|
{
|
||||||
|
if (TextureStore.spriteDict.ContainsKey(spriteRenderer.sprite.name) && spriteRenderer.drawMode != SpriteDrawMode.Sliced)
|
||||||
|
{
|
||||||
|
spriteRenderer.drawMode = SpriteDrawMode.Sliced;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -400,6 +400,7 @@
|
||||||
<Compile Include="Log.cs" />
|
<Compile Include="Log.cs" />
|
||||||
<Compile Include="ModFeatures.cs" />
|
<Compile Include="ModFeatures.cs" />
|
||||||
<Compile Include="AssetStore\AudioStore.cs" />
|
<Compile Include="AssetStore\AudioStore.cs" />
|
||||||
|
<Compile Include="Patches\GameObjects\Board_Patch.cs" />
|
||||||
<Compile Include="Patches\GameObjects\MinorObjects\Jigsaw_Patch.cs" />
|
<Compile Include="Patches\GameObjects\MinorObjects\Jigsaw_Patch.cs" />
|
||||||
<Compile Include="Patches\GameObjects\ShootingSelectWindow_Patch.cs" />
|
<Compile Include="Patches\GameObjects\ShootingSelectWindow_Patch.cs" />
|
||||||
<Compile Include="Patches\GameObjects\FruitNinjaSelectWindow_Patch.cs" />
|
<Compile Include="Patches\GameObjects\FruitNinjaSelectWindow_Patch.cs" />
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue