simple eating )
This commit is contained in:
@@ -10,6 +10,7 @@ public class ColaFreezer : BaseInteractableObject
|
||||
{
|
||||
if (!player.HasFoodObject())
|
||||
{
|
||||
player.BuyObject(_foodObjectSO);
|
||||
// Spawn new object and set to player
|
||||
var transform = Instantiate(_foodObjectSO.prefab, _playerArrivePoint);
|
||||
var foodObject = transform.GetComponent<FoodObject>();
|
||||
|
||||
@@ -4,7 +4,7 @@ using UnityEngine;
|
||||
|
||||
public class Fridge : BaseInteractableObject
|
||||
{
|
||||
private const int _maxCapacity=4;
|
||||
private const int _maxCapacity=10;
|
||||
private List<FoodObject> _foodObjects= new List<FoodObject>();
|
||||
|
||||
public override void Interact(Player player)
|
||||
@@ -20,6 +20,18 @@ public class Fridge : BaseInteractableObject
|
||||
else
|
||||
Debug.Log($"Fridge is full");
|
||||
}
|
||||
else
|
||||
{
|
||||
//Eat menu
|
||||
if (_foodObjects.Count>0)
|
||||
{
|
||||
while(player.Stats[StatsId.Food].Value< player.Stats[StatsId.Food].MaxValue && _foodObjects.Count > 0)
|
||||
{
|
||||
_foodObjects.RemoveAt(0);
|
||||
player.Eat();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user