|
|
@@ -10,6 +10,16 @@ public class Enemy : MonoBehaviour
|
|
|
private PowerLevels powerLevel;
|
|
|
private EnemyAI.BehaviorController behaviorController;
|
|
|
|
|
|
+ void OnCollisionEnter(Collision collision)
|
|
|
+ {
|
|
|
+ Debug.Log("hlk" + collision.collider.tag);
|
|
|
+
|
|
|
+ if (collision.collider.tag == "Bullet")
|
|
|
+ {
|
|
|
+ Death();
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
// Use this for initialization
|
|
|
void Start ()
|
|
|
{
|
|
|
@@ -29,4 +39,9 @@ public class Enemy : MonoBehaviour
|
|
|
|
|
|
behaviorController.Update();
|
|
|
}
|
|
|
+
|
|
|
+ private void Death()
|
|
|
+ {
|
|
|
+ GameObject.Destroy(gameObject);
|
|
|
+ }
|
|
|
}
|