//Jimmy Vegas Unity Tutorial //These scripts are for the enemies using System.Collections; using System.Collections.Generic; using UnityEngine; public class EnemyDeath : MonoBehaviour { public int enemyHealth = 20; public bool enemyDead = false; public GameObject enemyAI; public GameObject theEnemy; void DamageEnemy (int damageAmount) { enemyHealth -= damageAmount; } void Update() { if (enemyHealth <= 0 && enemyDead == false) { enemyDead = true; theEnemy.GetComponent().Play("Death"); enemyAI.SetActive(false); } } }