19 lines
559 B
C#
19 lines
559 B
C#
using UnityEngine;
|
|
|
|
namespace Syntriax.Modules.Trigger
|
|
{
|
|
public class Box2DColliderTriggerArea : ColliderTriggerAreaBase<Collider2D>
|
|
{
|
|
protected override int TriggerCount
|
|
=> Physics2D.OverlapBoxNonAlloc(transform.position, transform.localScale, 0, nonAllocResults, ColliderMask);
|
|
|
|
#if UNITY_EDITOR
|
|
private void OnDrawGizmosSelected()
|
|
{
|
|
Gizmos.color = previousTriggerCount > 0 ? Color.green : Color.red;
|
|
Gizmos.DrawWireCube(transform.position, transform.lossyScale);
|
|
}
|
|
#endif
|
|
}
|
|
}
|