#pragma strict
var health : int;
var Zombie : GameObject;
function Start ()
{
Zombie = GameObject.FindWithTag("Zombie");
health = 100;
}
function OnTriggerEnter(other : Collider)
{
if(other.tag == "shot")
{
health = health - 34;
}
}
function Update ()
{
if(health <= 0)
{
print("Enemy Down!!");
health = 0;
Destroy(Zombie);
}
}
↧