using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.UI; public class StoreMenuUI : MonoBehaviour { public Button exitBtn; // Start is called before the first frame update void Start() { exitBtn.onClick.AddListener(() => GameObject.FindGameObjectWithTag("GameController").GetComponent().CloseStore() ); } }