r2mods/ilspy_dump/ror2_csproj/RoR2.UI/DisableIfTextIsEmpty.cs

28 lines
456 B
C#
Raw Normal View History

2024-10-04 07:26:37 +00:00
using TMPro;
using UnityEngine;
namespace RoR2.UI;
public class DisableIfTextIsEmpty : MonoBehaviour
{
public GameObject[] gameObjects;
public TextMeshProUGUI tmpUGUI;
private bool isActive;
private void Update()
{
bool flag = !string.IsNullOrEmpty(tmpUGUI.text);
if (flag != isActive)
{
isActive = flag;
GameObject[] array = gameObjects;
for (int i = 0; i < array.Length; i++)
{
array[i].SetActive(isActive);
}
}
}
}