Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using UnityEngine;
- using System.Collections;
- public class Enemy : MonoBehaviour
- {
- public float health;
- // Use this for initialization
- void Start ()
- {
- }
- // Update is called once per frame
- void Update ()
- {
- }
- void onCollisionEnter2D(Collision2D coll)
- {
- if(coll.gameObject.tag == "Bullet")
- {
- health--;
- if (health <= 0)
- Destroy(gameObject);
- }
- if(coll.gameObject.tag == "??")
- {
- health--;
- if (health <= 0)
- Destroy(gameObject);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement