//Jimmy Vegas Unity Tutorial //This script is for your inventory using System.Collections; using System.Collections.Generic; using UnityEngine; public class InventoryControl : MonoBehaviour { public GameObject inventoryScreen; public GameObject inventoryFade; public AudioSource inventoryOpen; public bool isOpen = false; void Update() { if (Input.GetButton("Cancel") && isOpen == false) { isOpen = true; inventoryOpen.Play(); inventoryFade.SetActive(true); StartCoroutine(InvOpen()); } } IEnumerator InvOpen() { yield return new WaitForSeconds(0.25f); inventoryScreen.SetActive(true); yield return new WaitForSeconds(0.25f); inventoryFade.SetActive(false); } }