Exemple #1
0
 public void SellPlant()
 {
     GameManager.Instance.GiveMoney(currentPlant.GetComponent <AIPlantController>().plantInfo.plantReward);
     plantBluePrint = null;
     PoolsManagerPlants.Instance.ReleasePlant(currentPlant.gameObject);
     currentPlant = null;
     UIManager.Instance.DeselectPlantPoint();
 }
Exemple #2
0
 public void UpgradePlant()
 {
     GameManager.Instance.TakeMoney(plantBluePrint.upgradePrice);
     PoolsManagerPlants.Instance.ReleasePlant(currentPlant.gameObject);
     currentPlant = PoolsManagerPlants.Instance.GetPlant(plantBluePrint.upgradePlant.plantInfo.plantIndex).GetComponent <AIPlantController>();
     currentPlant.transform.position = transform.position;
     UIManager.Instance.DeselectPlantPoint();
 }
Exemple #3
0
    public void BuildPlant(PlantBluePrint blueprint)       //Luego de que se tenga una planta seleccionada cuando se escoja un nodo se construira ahi
    {
        GameObject plant = PoolsManagerPlants.Instance.GetPlant(blueprint.plant.plantInfo.plantIndex);

        plant.transform.position = transform.position;
        currentPlant             = plant.GetComponent <AIPlantController>();
        plantBluePrint           = blueprint;
        GameManager.Instance.TakeMoney(blueprint.price);
        plantPointPlayer.PlayClip();
    }
Exemple #4
0
 public void DestroyPlant()
 {
     plantBluePrint = null;
     currentPlant   = null;
 }