add basic inventory, fading walls
This commit is contained in:
@@ -3,13 +3,21 @@
|
||||
// this class is specifically referring to items in the world that can be picked up
|
||||
public class PickupableItem : Interactable
|
||||
{
|
||||
public Item item;
|
||||
public ItemIdEnum itemId;
|
||||
public int quantity;
|
||||
|
||||
private Item itemObj;
|
||||
|
||||
private void Start()
|
||||
{
|
||||
itemObj = new Item(itemId);
|
||||
Debug.Log(itemObj.itemName);
|
||||
}
|
||||
|
||||
public override void Interact()
|
||||
{
|
||||
if (GameManager.Instance.Inventory.AddItem(item))
|
||||
if (GameManager.Instance.Inventory.AddItem(itemObj, quantity))
|
||||
{
|
||||
Debug.Log("Picked up " + item.itemName + "!");
|
||||
MoveOutsideRange(); // I don't love this but if we destroy the object we probably need to do this first
|
||||
Destroy(gameObject);
|
||||
}
|
||||
@@ -17,7 +25,7 @@ public override void Interact()
|
||||
|
||||
public override void MoveInsideRange()
|
||||
{
|
||||
GameManager.Instance.DialogueManager.ShowItemText(item.itemName);
|
||||
GameManager.Instance.DialogueManager.ShowItemText(itemObj.itemName);
|
||||
}
|
||||
|
||||
public override void MoveOutsideRange()
|
||||
|
||||
Reference in New Issue
Block a user