private void UpdateVisuals(PlantDisplay p) { image.sprite = p.pSprite; waterText.text = "Água: " + p.water.ToString("F0"); waterSld.value = p.water; lightText.text = "Luz: " + p.pLight.ToString("F0"); healthText.text = "Saúde: " + p.health.ToString("F0"); }
void Awake() { if (instance == null) { instance = this; } SelectedPlant = plants[0]; }
public void BuyPlant(PlantDisplay p) { if (p.plant.plantPrice <= happinessCurrency && p.owned == false) { happinessCurrency -= p.plant.plantPrice; plants.Add(p); p.owned = true; p.gameObject.SetActive(true); } }
public void SelectPlant(PlantDisplay p) { SelectedPlant = p; }
private void ReduceStatus(PlantDisplay p) //Redução do status de água das plantas pelo tempo { p.water -= Time.deltaTime * 0.5f; p.pLight -= Time.deltaTime * 0.5f; p.health -= Time.deltaTime * 0.5f; }