Files
EcoSim/Assets/GameAssets/Scripts/Core.cs
T
Alex 6632f02d1c Updated plant behavior
V1- Don't like how the variables are interacting. Will be rewriting plant behavior.
2025-08-09 20:31:25 -07:00

38 lines
859 B
C#

using System.Collections.Generic;
using UnityEngine;
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;
private void Awake()
{
instance = this;
}
// 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;
}
}
}