2023-02-16 13:07:14 +03:00
|
|
|
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)
|
2023-03-20 22:24:18 +03:00
|
|
|
Gizmos.color = previousTriggerCount > 0 && StateEnable.IsEnabled ? Color.green : Color.red;
|
2023-02-16 13:07:14 +03:00
|
|
|
else
|
|
|
|
Gizmos.color = TriggerCount > 0 ? Color.green : Color.red;
|
|
|
|
|
2023-02-16 13:54:18 +03:00
|
|
|
Gizmos.matrix = transform.localToWorldMatrix;
|
|
|
|
Gizmos.DrawWireCube(Vector3.zero, Vector3.one);
|
2023-02-16 13:07:14 +03:00
|
|
|
}
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
}
|