public void Grow() { if (_health != HealthStates.Dry) { switch (_age) { case PlantStates.Seeds: _age = PlantStates.Young; seedsPrefab.SetActive(false); youngPrefab.SetActive(true); break; case PlantStates.Young: _age = PlantStates.Adult; youngPrefab.SetActive(false); adultPrefab.SetActive(true); break; default: break; } } _health = HealthStates.Dry; wateredPlot.SetActive(false); overWateredPlot.SetActive(false); drownedPlot.SetActive(false); }
// Use this for initialization void Start() { thisPlantsState = PlantStates.sprout; transform.localScale = new Vector3 (startsize, startsize, 1); startHeight= transform.position.y - startPositionOffset; endHeight = transform.position.y; //transform.position.y = startHeight - startPositionOffset; }
public void Plant() { if (_age == PlantStates.Empty) { _age = PlantStates.Seeds; seedsPrefab.SetActive(true); } }
public void GetPlantStateTest() { //ARRANGE var plantState = new PlantStates(); PlantState plant = PlantState.healthy; var expectedResult = "healthy"; //ACT PlantState result = plantState.GetPlantState(expectedResult); //ASSERT Assert.AreEqual(expectedResult, result); }
public bool Harvested() { if (_age == PlantStates.Adult) { _age = PlantStates.Empty; seedsPrefab.SetActive(false); youngPrefab.SetActive(false); adultPrefab.SetActive(false); wateredPlot.SetActive(false); overWateredPlot.SetActive(false); drownedPlot.SetActive(false); return(true); } return(false); }
void Start() { _age = PlantStates.Empty; _health = HealthStates.Dry; seedsPrefab.SetActive(true); youngPrefab.SetActive(true); adultPrefab.SetActive(true); wateredPlot.SetActive(true); overWateredPlot.SetActive(true); drownedPlot.SetActive(true); seedsPrefab.SetActive(false); youngPrefab.SetActive(false); adultPrefab.SetActive(false); wateredPlot.SetActive(false); overWateredPlot.SetActive(false); drownedPlot.SetActive(false); }
public void SetAge(PlantStates age) { _age = age; }