Let's begin with the Inventory Panel. We want the panel to pop up and close when the i key is pressed on the keyboard. To make the Inventory Panel appear and disappear with the i key, complete the following steps:
- Create a new C# script in the Assets/Scripts folder by right-clicking within the Project view of the folder and selecting Create | C# Script from the pop-up panel.
- Name the script ShowHidePanels, and then double-click on it to open.
- We will now go to the public CanvasGroup variable called inventoryPanel to represent the panel. We will use a CanvasGroup variable type to reference the panel, since we want to access the properties of the Canvas Group component. Update your ShowHidePanels script ...