using HarmonyLib; using Il2Cpp; using Il2CppTMPro; using PvZ_Fusion_Translator.AssetStore; using UnityEngine; namespace PvZ_Fusion_Translator.Patches.GameObjects { [HarmonyPatch(typeof(TowerUpgradeMenu))] public static class TowerUpgradeMenu_Patch { [HarmonyPatch(nameof(TowerUpgradeMenu.Update))] [HarmonyPostfix] private static void Update(TowerUpgradeMenu __instance) { foreach(TextMeshProUGUI text in __instance.GetComponentsInChildren()) { text.text = StringStore.TranslateText(text.text); text.font = FontStore.LoadTMPFont(Utils.Language.ToString()); } } } }