Updated plant behavior
V1- Don't like how the variables are interacting. Will be rewriting plant behavior.
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user