public void SellPlant() { GameManager.Instance.GiveMoney(currentPlant.GetComponent <AIPlantController>().plantInfo.plantReward); plantBluePrint = null; PoolsManagerPlants.Instance.ReleasePlant(currentPlant.gameObject); currentPlant = null; UIManager.Instance.DeselectPlantPoint(); }
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(); }
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(); }
public void DestroyPlant() { plantBluePrint = null; currentPlant = null; }