Updated plant behavior

V1- Don't like how the variables are interacting. Will be rewriting plant behavior.
This commit is contained in:
2025-08-09 20:31:25 -07:00
parent 0c0af9e6a6
commit 6632f02d1c
6 changed files with 282 additions and 72 deletions
+12 -3
View File
@@ -6,6 +6,9 @@ public class Core : MonoBehaviour
[SerializeField] public NutrientController nutrientCont;
[SerializeField] public PlantController plantCont;
[SerializeField] public Terrain ground;
[SerializeField, Range(0, 10)] public float speedOfStep;
float timeSoFar;
public static Core instance;
@@ -16,13 +19,19 @@ public class Core : MonoBehaviour
// Start is called once before the first execution of Update after the MonoBehaviour is created
void Start()
{
{
timeSoFar = 0;
}
// Update is called once per frame
void Update()
{
timeSoFar += Time.deltaTime;
if(timeSoFar >= speedOfStep)
{
plantCont.Step(timeSoFar);
nutrientCont.Step(timeSoFar);
timeSoFar = 0;
}
}
}