24 lines
575 B
C#
24 lines
575 B
C#
using HarmonyLib;
|
|
using System;
|
|
using UnityEngine;
|
|
|
|
namespace CustomCosmeticLoader.Patches
|
|
{
|
|
[HarmonyPatch(typeof(MarbleHolder), nameof(MarbleHolder.SetMarble))]
|
|
internal class MarbleHolderSetMarblePatch
|
|
{
|
|
static void Postfix(MarbleHolder __instance, Cosmetic marbleObject)
|
|
{
|
|
if (!Config.enabled)
|
|
return;
|
|
|
|
if (marbleObject.Id != Config.skinNameToHijack && Config.skinNameToHijack != "*")
|
|
return;
|
|
|
|
if (!Config.inCosmeticMenu && __instance == CosmeticPanel.cosmHolder)
|
|
return;
|
|
|
|
Shared.ApplyCustomTexture(__instance.currentMarble);
|
|
}
|
|
}
|
|
}
|