food position fix
This commit is contained in:
@@ -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()
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user