Project_WL/Assets/Script/UI/Common/BotMenu.cs

30 lines
608 B
C#

using System.Collections;
using System.Collections.Generic;
using TMPro;
using UnityEngine;
public class BotMenu : MonoBehaviourSingletonTemplate<BotMenu>
{
public TextMeshProUGUI text_onoff;
public Transform tf_layout;
bool bOn = true;
private void OnEnable()
{
Set_OnOff();
}
void Set_OnOff()
{
text_onoff.text = bOn ? "Menu\nOn" : "Menu\nOff";
for (int i = 1; i < tf_layout.childCount; i++)
tf_layout.GetChild(i).gameObject.SetActive(bOn);
}
public void OnClick_OnOff()
{
bOn = !bOn;
Set_OnOff();
}
}