Unity敌人每秒减少一点能量
private int energy=100;
public Text energysNum;
void Update()
{
if (Time.time >= nextTime)
{
energy--;
energysNum.text = energy.ToString();
if (energy == 0)
{
Invoke("success", 0.5f);
}
nextTime = Time.time + 1;
}
}
既已览卷至此,何不品评一二: