Eonirr

Untitled

Jan 21st, 2026
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.57 KB | None | 0 0
  1. // sur ton child collider detector : --------------------------------
  2.  
  3. void OnTriggerEnter2D(Collider2D other)
  4. {
  5. if (!other.CompareTag("Player")) return;
  6.  
  7. enemy.Activate();
  8. }
  9.  
  10. // sur ton enemy -----------------------------
  11. bool isActive;
  12.  
  13. public void Activate()
  14. {
  15. if (isActive)
  16. return;
  17.  
  18. isActive = true;
  19. }
  20. public void Deactivate()
  21. {
  22. if (!isActive)
  23. return;
  24.  
  25. isActive = false;
  26. }
  27. void OnTriggerEnter2D(Collider2D other)
  28. {
  29. if (!other.CompareTag("Player")) return;
  30.  
  31. PIF PAF POUF
  32. }
  33.  
Advertisement
Add Comment
Please, Sign In to add comment