add field functinallity

This commit is contained in:
Janis
2023-03-05 17:03:16 +01:00
parent 71447ac83e
commit 95b70a77db
15 changed files with 215 additions and 102 deletions

View File

@@ -2,9 +2,40 @@ using UnityEngine;
public class FarmManager : MonoBehaviour
{
public Inventory<Crop> cropInventory;
// Singleton
public static FarmManager Instance { get; private set; }
[SerializeField]
private Inventory<Crop> cropInventory;
[SerializeField]
private Inventory<Harvest> harvestInventory;
public Inventory<Crop> CropInventory
{
get { return cropInventory; }
}
public Inventory<Harvest> HarvestInventory
{
get { return harvestInventory; }
}
private void Awake()
{
if (Instance == null)
{
Instance = this;
}
else
{
Destroy(gameObject);
}
}
private void Start()
{
cropInventory = new Inventory<Crop>(2, 200);
harvestInventory = new Inventory<Harvest>(2, 200);
}
}