using System.Collections; using System.Collections.Generic; using UnityEngine; public class CloseIfPanelOpen : MonoBehaviour { public GameObject Panel; public GameObject EPanel; public GameObject SpacePanel; public GameObject EPanel2; public GameObject SpacePanel2; void Update() { if (Panel.active == true) { EPanel.SetActive(false); SpacePanel.SetActive(false); EPanel2.SetActive(false); SpacePanel2.SetActive(false); } } }