mirror of
https://github.com/DerTyp7/harvestdale-unity.git
synced 2025-10-30 04:57:09 +01:00
add field functinallity
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user