using UnityEngine; public class TreeComponent : MonoBehaviour { public enum TreeGrowth { Seed, Sapling, Tree } public GameObject tree; public TreeGrowth treeGrowth = TreeGrowth.Seed; public Sprite winterTree; public Sprite springTree; public Sprite summerTree; public Sprite fallTree; public Sprite saplingTree; public void GrowTree() { var treeRenderer = tree.GetComponent(); if (treeGrowth == TreeGrowth.Seed) { treeGrowth = TreeGrowth.Sapling; treeRenderer.sprite = saplingTree; tree.SetActive(true); } else if (treeGrowth == TreeGrowth.Sapling) { treeGrowth = TreeGrowth.Tree; // tODO: implement seasons SetCurrentSeason("spring"); tree.SetActive(true); } } public void SetCurrentSeason(string season) { if (treeGrowth == TreeGrowth.Tree) { var treeRenderer = tree.GetComponent(); if (season == "winter") treeRenderer.sprite = winterTree; else if (season == "spring") treeRenderer.sprite = springTree; else if (season == "summer") treeRenderer.sprite = summerTree; else if (season == "fall") treeRenderer.sprite = fallTree; else Debug.Log("Tree not found for season: " + season); } } }