oof ouch owie

This commit is contained in:
reisenlol 2026-01-31 01:28:11 -08:00
parent e29208a2e5
commit 3364b5df68
No known key found for this signature in database
5 changed files with 122 additions and 14 deletions

View file

@ -0,0 +1,23 @@
using System;
using UnityEngine;
public class BeamCollider : MonoBehaviour
{
public Laser thisLaser;
private void OnTriggerEnter2D(Collider2D other)
{
if (!other.CompareTag(thisLaser.thisPlayer.tag) && other.TryGetComponent(out Entity isEntity))
{
thisLaser.enemyList.Add(isEntity);
}
}
private void OnTriggerExit2D(Collider2D other)
{
if (!other.CompareTag(thisLaser.thisPlayer.tag) && other.TryGetComponent(out Entity isEntity) && thisLaser.enemyList.Contains(isEntity))
{
thisLaser.enemyList.Remove(isEntity);
}
}
}