using UnityEngine;
using System.Collections;
public class BossController : MonoBehaviour {
public float bossHealth;
public GameObject explosion;
public int scoreValue;
private GameController gameController;
void OnTriggerEnter (Collider other)
{
if (other.CompareTag ("Boundary") || other.CompareTag ("Enemy"))
{
return;
}
bossHealth = bossHealth - 1;
if (bossHealth == 0)
{
Instantiate (explosion, transform.position, transform.rotation);
Destroy (gameObject);
gameController.AddScore (scoreValue);
}
}
}
No comments:
Post a Comment