23 lines
730 B
C#
23 lines
730 B
C#
|
using UnityEngine;
|
||
|
|
||
|
namespace Syntriax.Modules.Trigger
|
||
|
{
|
||
|
public class BoxColliderTriggerArea : ColliderTriggerAreaBase<Collider>
|
||
|
{
|
||
|
protected override int TriggerCount
|
||
|
=> Physics.OverlapBoxNonAlloc(transform.position, transform.localScale * .5f, nonAllocResults, transform.rotation, ColliderMask);
|
||
|
|
||
|
#if UNITY_EDITOR
|
||
|
private void OnDrawGizmosSelected()
|
||
|
{
|
||
|
if (UnityEditor.EditorApplication.isPlaying)
|
||
|
Gizmos.color = previousTriggerCount > 0 ? Color.green : Color.red;
|
||
|
else
|
||
|
Gizmos.color = TriggerCount > 0 ? Color.green : Color.red;
|
||
|
|
||
|
Gizmos.DrawWireCube(transform.position, transform.lossyScale);
|
||
|
}
|
||
|
#endif
|
||
|
}
|
||
|
}
|