Import 2D Level

This commit is contained in:
2026-04-30 00:53:30 +02:00
parent c67979c7cf
commit 5797038baf
479 changed files with 430785 additions and 0 deletions
@@ -0,0 +1,22 @@
using UnityEngine;
using UnityEngine.Events;
public class SimpleTrigger : MonoBehaviour
{
public Rigidbody2D triggerBody;
public UnityEvent onTriggerEnter;
void OnTriggerEnter2D(Collider2D other){
//do not trigger if there's no trigger target object
if (triggerBody == null) return;
//only trigger if the triggerBody matches
var hitRb = other.attachedRigidbody;
if (hitRb == triggerBody){
onTriggerEnter.Invoke();
}
}
}