GunExplosionBoom.cs 471 B

12345678910111213141516171819202122232425
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. public class GunExplosionBoom : MonoBehaviour {
  5. public int damage;
  6. void Start () {
  7. Destroy(gameObject, 0.1f);
  8. }
  9. // Update is called once per frame
  10. void Update () {
  11. }
  12. void OnTriggerEnter(Collider col)
  13. {
  14. EnemyMovement enemy = col.GetComponent<EnemyMovement>();
  15. if (enemy != null)
  16. {
  17. enemy.Damage(damage);
  18. }
  19. }
  20. }