literally half of the game
This commit is contained in:
parent
1590b5faa6
commit
b842289076
77 changed files with 11904 additions and 72 deletions
32
Assets/Scripts/GatheringSpot.cs
Normal file
32
Assets/Scripts/GatheringSpot.cs
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
public class GatheringSpot : MonoBehaviour
|
||||
{
|
||||
[Serializable]
|
||||
public class ItemAmount
|
||||
{
|
||||
public Item item;
|
||||
public int amount;
|
||||
}
|
||||
public List<ItemAmount> gatherableItems = new();
|
||||
public bool hasGathered;
|
||||
|
||||
public void Gather()
|
||||
{
|
||||
foreach (ItemAmount item in gatherableItems)
|
||||
{
|
||||
InventoryManager.instance.AddItem(item.item, item.amount);
|
||||
//needs check for if inventory cannot fit
|
||||
}
|
||||
hasGathered = true;
|
||||
gameObject.SetActive(false);
|
||||
}
|
||||
|
||||
private void OnMouseDown()
|
||||
{
|
||||
//placeholder function to add items
|
||||
Gather();
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue