using HarmonyLib; using System; using UnityEngine; namespace CustomCosmeticLoader.Patches { [HarmonyPatch(typeof(MarbleController), nameof(MarbleController.ApplyMyCosmetics))] internal class MarbleControllerApplyMyCosmeticsPatch { [HarmonyPostfix] static void Postfix(MarbleController __instance) { if (!Config.enabled) return; if (Config.skinNameToHijack == "*") return; if (Shared.SkinToHijack == null) return; MarbleHolder mHolder = __instance.MHolder; string actualSkinId = mHolder.CosmeticSet.skin; mHolder.SetMarble(Shared.SkinToHijack); // Setting the skin id here allows others in multiplayer/replays to see your normal skin mHolder.CosmeticSet.skin = actualSkinId; } } }