예제 #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();
 }
예제 #2
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();
    }
예제 #3
0
 //Esta parte del script esta dedicada a las funiones de la UI de las plantas. Tanto para la UI de la
 //planta como el UI de construccion.
 public void PurchasePlant(PlantBluePrint bluePrint)
 {
     if (GameManager.Instance.playerMoney >= bluePrint.price)
     {
         currentPlantPoint.BuildPlant(bluePrint);
         DeselectBuildPoint();
     }
     else
     {
         return;
     }
 }
예제 #4
0
 public void DestroyPlant()
 {
     plantBluePrint = null;
     currentPlant   = null;
 }