I am having difficulties, figuring out how to add items. To a new loot window. To act as a loot drop for the player. Any help and advice will be great
public void RandomDrop()
{
//var baseStats = GetComponent<BaseStats>();
var drops = dropLibrary.GetRandomDrops(8);
foreach (var drop in drops)
{
inventory.AddToFirstEmptySlot(drop.item,drop.number);
}
}
public class LootBox : MonoBehaviour
{
private void OnTriggerEnter(Collider other)
{
var player = GameObject.FindGameObjectWithTag("Player");
if (other.gameObject == player)
{
if (Input.GetKey(KeyCode.E))
{
FindObjectOfType<ShowHideUI>().ShowOtherInventory(gameObject);
}
}
}
}