you really gotta calm down, marisa...
This commit is contained in:
parent
13bb58ea03
commit
b9fb490dce
68 changed files with 990 additions and 44 deletions
23
Assets/Scripts/Abilities/PlayerAbilities/BeamCollider.cs
Normal file
23
Assets/Scripts/Abilities/PlayerAbilities/BeamCollider.cs
Normal 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);
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue