quartz/InventoryFlow.md at cli · Signal-K/quartz
Canvas GameObject
Slot (#) (# = number, starting at 1) for the hotbar slotCross (#) for the drop cross (click the cross icon next to the slot to drop the item)New script (Inventory.cs):
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Inventory: MonoBehaviour {
public bool[] isFull; // Array to see if there is already an item in the inventory slot
public GameObject[] slots; // Pair the item the player picks up to a given inventory slot
}
Size of Is Full and Slots arrays in the Unity inspector (attach the script Inventory.cs to the player game object) to the number of items required (this can also be modified by scripts depending on the scene)Health, Health #, Sun, Sun #, Food, Food #Health 1 vs Health 2) can be represented by different images even though they behave the same way, due to the script attached to them.Pickup.cs, has two public GameObject parameters → itemButton (the item itself, which is stored in Assets/Prefabs/Butons/<#Button>) and the Effect → Assets/Prefabs/Effects