void addplant(plantBluePrint thisPlant) { if (!buildManager.HasMoney) { Debug.Log("don't have enough money!"); return; } playerStats.LightCount -= thisPlant.cost; //应该修改为植物的价格。 GameObject hp_bar = thisPlant.plantPrefeb; hp_bar = Instantiate(hp_bar, GetBuildPosition(), Quaternion.identity); //hp_bar.GetComponent<plantHealth> ().grass = gameObject; //一旦该植物被摧毁,将这个草地上的植物变量表示为空 hp_bar.transform.parent = GetComponent <RectTransform> (); //????? //Debug.Log (plants.GetComponent<plantHealth> ().health); plants = hp_bar; }
public void DeSelectPlant() { plantToBuild = null; Destroy(dragPic); }
public void SelectTurretToBuild(plantBluePrint plant) { plantToBuild = plant; }