Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // sur ton child collider detector : --------------------------------
- void OnTriggerEnter2D(Collider2D other)
- {
- if (!other.CompareTag("Player")) return;
- enemy.Activate();
- }
- // sur ton enemy -----------------------------
- bool isActive;
- public void Activate()
- {
- if (isActive)
- return;
- isActive = true;
- }
- public void Deactivate()
- {
- if (!isActive)
- return;
- isActive = false;
- }
- void OnTriggerEnter2D(Collider2D other)
- {
- if (!other.CompareTag("Player")) return;
- PIF PAF POUF
- }
Advertisement
Add Comment
Please, Sign In to add comment