Enemy.cs 368 B

12345678910111213141516171819202122
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. public class Enemy : MonoBehaviour
  5. {
  6. protected static int count = 0;
  7. public GameObject GamePassPenel;
  8. private void OnMouseDown()
  9. {
  10. count++;
  11. Destroy(gameObject);
  12. if (count >= 6)
  13. {
  14. GamePassEvent.Trigger();
  15. }
  16. }
  17. }