using UnityEngine; public class BotMenu : MonoBehaviourSingletonTemplate { public Transform tf_layout; bool bOn = true; private void OnEnable() { Set_OnOff(); } void Set_OnOff() { for (int i = 0; i < tf_layout.childCount; i++) tf_layout.GetChild(i).gameObject.SetActive(bOn); } public void OnClick_OnOff() { bOn = !bOn; Set_OnOff(); } }