so i’m following a tutorial on how to make a shop and after writing the code i got an error that said “The type or namespace name ‘EventSystem’ could not be found”
here’s the code
using UnityEngine;
using TMPro;
public class ShopManagerScript : MonoBehaviour
{
public int[,] shopItems = new int[6, 6];
public float PlayerCash;
public TMP_Text PlayerCashTxt;
void Start()
{
PlayerCashTxt.text = "$" + PlayerPrefs.GetFloat("PlayerCash").ToString();
// IDs
shopItems[1, 1] = 1;
shopItems[1, 2] = 2;
shopItems[1, 3] = 3;
shopItems[1, 4] = 4;
shopItems[1, 5] = 5;
shopItems[1, 6] = 6;
// Price
shopItems[2, 1] = 1000;
shopItems[2, 2] = 1000;
shopItems[2, 3] = 1000;
shopItems[2, 4] = 1000;
shopItems[2, 5] = 1000;
shopItems[2, 6] = 1000;
}
public void Buy()
{
GameObject ButtonRef = GameObject.FindGameObjectWithTag("Event").GetComponent<EventSystem>().currentSelectedGameObject;
}
}
the code is in the empty GameObject ShopManager