add explodable script

This commit is contained in:
2026-07-15 21:23:59 -05:00
parent 2715ba7a86
commit 16342f1ff4
8 changed files with 5368 additions and 2 deletions
@@ -0,0 +1,18 @@
using UnityEngine;
// Put this on an empty game object with a trigger collider. Anything inside of this
// trigger collider with an Explodable script will explode
public class Explosion : MonoBehaviour
{
private void OnTriggerEnter(Collider other)
{
if (other != null)
{
Explodable explodable = other.GetComponent<Explodable>();
if (explodable != null)
{
explodable.Explode();
}
}
}
}