Пример #1
0
 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");
 }
Пример #2
0
    void Awake()
    {
        if (instance == null)
        {
            instance = this;
        }

        SelectedPlant = plants[0];
    }
Пример #3
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);
     }
 }
Пример #4
0
 public void SelectPlant(PlantDisplay p)
 {
     SelectedPlant = p;
 }
Пример #5
0
 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;
 }