food position fix

This commit is contained in:
2024-04-03 09:45:30 +02:00
parent 5646ed6504
commit 7c026e34ff
5 changed files with 308 additions and 297 deletions

View File

@@ -5,18 +5,26 @@ using UnityEngine;
public class Dish : MonoBehaviour
{
public List <GameObject> RequiredIngredients;
public int NutritionalValue;
public int NutritionalValue = 0;
// Start is called before the first frame update
void Start()
{
if (NutritionalValue > 0) {
return;
}
NutritionalValue = 0;
foreach (GameObject Ingredient in RequiredIngredients) {
int IngredientValue = Ingredient.GetComponent<Ingredient>().NutritionalValue;
NutritionalValue += IngredientValue;
}
}
// Update is called once per frame
void Update()
{
}
}