Files
EndlessHostRoles/Modules/Extensions/ObjectHelper.cs
T
PHGaming121 370dc1b21a Add /changesetting command (#108)
* Modify and apply COOL animations in Main Menu

Credits for code: TONX and MoreGamemodes

* Remove EHR logo and bring back Among Us text

@HyperAtill request on DIscord

* bro, credits are fixed 💀 💀

* add Website, Discord, and Github Button (from TOHE)

* bro 💀

* forgot to add in en-us

* this should fix it

* Add /changesetting command

* fix?

* fix
2024-06-28 16:01:10 +02:00

17 lines
514 B
C#

using UnityEngine;
namespace EHR;
public static class ObjectHelper
{
public static void DestroyTranslator(this GameObject obj)
{
if (obj == null) return;
obj.ForEachChild((Il2CppSystem.Action<GameObject>)DestroyTranslator); // False error
TextTranslatorTMP[] translator = obj.GetComponentsInChildren<TextTranslatorTMP>(true);
translator?.Do(Object.Destroy);
}
public static void DestroyTranslator(this MonoBehaviour obj) => obj?.gameObject.DestroyTranslator();
}