feat: In Editor TriggerArea Visual Checking Added
This commit is contained in:
parent
8b3721eba3
commit
8356f72d6d
|
@ -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
|
||||||
|
|
|
@ -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);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue