Example #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();
 }
Example #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();
 }
Example #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();
    }
Example #4
0
 public void DestroyPlant()
 {
     plantBluePrint = null;
     currentPlant   = null;
 }