destory bad things

This commit is contained in:
Josiah
2026-02-01 14:19:40 -06:00
parent 86381e4067
commit 2aca024b1c
3 changed files with 70 additions and 0 deletions
+8
View File
@@ -5,6 +5,8 @@ public class TrickCollisionManager : MonoBehaviour
[SerializeField] private string trickLayerName = "Trick";
[SerializeField] private string playerLayerName = "Player";
[SerializeField] private string treatLayerName = "Treat";
[SerializeField] private string destroyTag = "Destroy";
private bool initialized;
private void Awake()
@@ -43,4 +45,10 @@ public class TrickCollisionManager : MonoBehaviour
Physics2D.IgnoreLayerCollision(trickLayer, otherLayer, true);
}
private void onTriggerEnter2D(Collider2D destroy){
if (destroy.CompareTag(destroyTag))
{
Destroy(gameObject);
}
}
}