feat: In Editor TriggerArea Visual Checking Added

This commit is contained in:
Syntriax 2023-02-16 13:06:35 +03:00
parent 8b3721eba3
commit 8356f72d6d
2 changed files with 8 additions and 2 deletions

View File

@ -10,7 +10,10 @@ namespace Syntriax.Modules.Trigger
#if UNITY_EDITOR #if UNITY_EDITOR
private void OnDrawGizmosSelected() private void OnDrawGizmosSelected()
{ {
if (UnityEditor.EditorApplication.isPlaying)
Gizmos.color = previousTriggerCount > 0 ? Color.green : Color.red; Gizmos.color = previousTriggerCount > 0 ? Color.green : Color.red;
else
Gizmos.color = TriggerCount > 0 ? Color.green : Color.red;
Gizmos.DrawWireCube(transform.position, transform.lossyScale); Gizmos.DrawWireCube(transform.position, transform.lossyScale);
} }
#endif #endif

View File

@ -10,7 +10,10 @@ namespace Syntriax.Modules.Trigger
#if UNITY_EDITOR #if UNITY_EDITOR
private void OnDrawGizmosSelected() private void OnDrawGizmosSelected()
{ {
if (UnityEditor.EditorApplication.isPlaying)
Gizmos.color = previousTriggerCount > 0 ? Color.green : Color.red; Gizmos.color = previousTriggerCount > 0 ? Color.green : Color.red;
else
Gizmos.color = TriggerCount > 0 ? Color.green : Color.red;
Gizmos.matrix = transform.localToWorldMatrix; Gizmos.matrix = transform.localToWorldMatrix;
Gizmos.DrawWireCube(Vector3.zero, Vector3.one); Gizmos.DrawWireCube(Vector3.zero, Vector3.one);
} }