using System; using System.Collections; using System.Collections.Generic; using UnityEngine; public class InventorySystem : MonoBehaviour { public static InventorySystem Instance { get; set; } public GameObject Inventory; public List slotList = new List(); public ListitemList = new List(); private GameObject itemToAdd; private GameObject whatSlotToEquip; public bool isOpen; public bool isFull; private void Awake() { if (Instance != null && Instance != this) { Destroy(gameObject); } else { Instance = this; } } void Start() { isOpen = false; } void Update() { if (Input.GetKeyDown(KeyCode.Tab) && !isOpen) { Debug.Log("Tab is pressed"); Inventory.SetActive(true); isOpen = true; } else if (Input.GetKeyDown(KeyCode.Tab) && isOpen) { Inventory.SetActive(false); isOpen = false; } } }