private void GrowingUp() { Debug.Log("Growing up"); switch (currentGrowth) { case StageOfGrowth.seedling: currentGrowth = StageOfGrowth.first; ObjectPool.Recycle(plantMesh, StageOfGrowth.seedling); plantMesh = ObjectPool.GetFirstStage(transform.parent.gameObject); break; case StageOfGrowth.first: currentGrowth = StageOfGrowth.second; ObjectPool.Recycle(plantMesh, StageOfGrowth.first); plantMesh = ObjectPool.GetSecondStage(transform.parent.gameObject); ChangingBerryColors(); break; case StageOfGrowth.second: currentGrowth = StageOfGrowth.final; ObjectPool.Recycle(plantMesh, StageOfGrowth.second); plantMesh = ObjectPool.GetThirdStage(transform.parent.gameObject); ChangingBerryColors(); break; case StageOfGrowth.final: break; default: break; } PlantGrew?.Invoke(this); //Only runs if plant grew is not null }
private void GrowingUp() { Debug.Log("Growing up"); switch (currentGrowth) { case StageOfGrowth.seedling: currentGrowth = StageOfGrowth.first; ImageScaling(.2f); break; case StageOfGrowth.first: currentGrowth = StageOfGrowth.second; ImageScaling(.4f); break; case StageOfGrowth.second: currentGrowth = StageOfGrowth.third; ImageScaling(.7f); break; case StageOfGrowth.third: currentGrowth = StageOfGrowth.final; ImageScaling(1f); break; case StageOfGrowth.final: break; default: break; } PlantGrew?.Invoke(this); //Only runs if plant grew is not null }