using System.Collections; using System.Collections.Generic; using UnityEngine; public class MenuController_2 : MonoBehaviour { public GameObject[] menuObjs; public void closeAllMenu() { foreach (GameObject i in menuObjs) { i.SetActive(false); } } public void openMenu(int i) { closeAllMenu(); menuObjs[i].SetActive(true); } }