using HarmonyLib; using UnityEngine; namespace EHR; public static class ObjectHelper { /// /// オブジェクトのコンポーネントを破棄します /// public static void DestroyTranslator(this GameObject obj) { if (obj == null) return; obj.ForEachChild((Il2CppSystem.Action)DestroyTranslator); TextTranslatorTMP[] translator = obj.GetComponentsInChildren(true); translator?.Do(Object.Destroy); } /// /// オブジェクトのコンポーネントを破棄します /// public static void DestroyTranslator(this MonoBehaviour obj) => obj?.gameObject?.DestroyTranslator(); }