I'm trying to make my game end when all my enemies died but I keep getting stuck. I'm new to Unity and I would apreciate some help. I got a script from internet and I'm Trying to adjust it to the way I want it. Here is the script im using at the moment:
using UnityEngine;
using System.Collections;
public class EnemyHealth : MonoBehaviour {
public int currentHealth;
public int maximumHealth = 100;
public float hbLength;
// Use this for initialization
void Start () {
currentHealth = maximumHealth;
/*
hbLength = Screen.width / 2;
*/
}
// Update is called once per frame
void Update () {
ChangeHealth(0);
if(currentHealth <= 0)Destroy(gameObject);
if (GameObject.FindWithTag ("Enemy") == null)
print ("Good Job you killed them all");
Application.LoadLevel ("Game Over Screen")
}
/*
void OnGUI (){
GUI.Box (new Rect(10, 10, hbLength, 30), currentHealth + " / " + maximumHealth);
}
*/
public void ChangeHealth (int health) {
currentHealth += health;
}
}
I would realy apreciate any help and suggestions. oh and the error I keep getting is:Assets/EnemyHealth.cs(27,9): error CS1525: Unexpected symbol `}'
↧