feat: Added State Enabled Integration to Editor Visualization Of Collider Triggers
This commit is contained in:
parent
f2faa86f65
commit
c8105122fb
|
@ -11,7 +11,7 @@ namespace Syntriax.Modules.Trigger
|
||||||
private void OnDrawGizmosSelected()
|
private void OnDrawGizmosSelected()
|
||||||
{
|
{
|
||||||
if (UnityEditor.EditorApplication.isPlaying)
|
if (UnityEditor.EditorApplication.isPlaying)
|
||||||
Gizmos.color = previousTriggerCount > 0 ? Color.green : Color.red;
|
Gizmos.color = previousTriggerCount > 0 && StateEnable.IsEnabled ? Color.green : Color.red;
|
||||||
else
|
else
|
||||||
Gizmos.color = TriggerCount > 0 ? Color.green : Color.red;
|
Gizmos.color = TriggerCount > 0 ? Color.green : Color.red;
|
||||||
Gizmos.DrawWireCube(transform.position, transform.lossyScale);
|
Gizmos.DrawWireCube(transform.position, transform.lossyScale);
|
||||||
|
|
|
@ -11,7 +11,7 @@ namespace Syntriax.Modules.Trigger
|
||||||
private void OnDrawGizmosSelected()
|
private void OnDrawGizmosSelected()
|
||||||
{
|
{
|
||||||
if (UnityEditor.EditorApplication.isPlaying)
|
if (UnityEditor.EditorApplication.isPlaying)
|
||||||
Gizmos.color = previousTriggerCount > 0 ? Color.green : Color.red;
|
Gizmos.color = previousTriggerCount > 0 && StateEnable.IsEnabled ? Color.green : Color.red;
|
||||||
else
|
else
|
||||||
Gizmos.color = TriggerCount > 0 ? Color.green : Color.red;
|
Gizmos.color = TriggerCount > 0 ? Color.green : Color.red;
|
||||||
Gizmos.matrix = transform.localToWorldMatrix;
|
Gizmos.matrix = transform.localToWorldMatrix;
|
||||||
|
|
|
@ -11,7 +11,7 @@ namespace Syntriax.Modules.Trigger
|
||||||
private void OnDrawGizmosSelected()
|
private void OnDrawGizmosSelected()
|
||||||
{
|
{
|
||||||
if (UnityEditor.EditorApplication.isPlaying)
|
if (UnityEditor.EditorApplication.isPlaying)
|
||||||
Gizmos.color = previousTriggerCount > 0 ? Color.green : Color.red;
|
Gizmos.color = previousTriggerCount > 0 && StateEnable.IsEnabled ? Color.green : Color.red;
|
||||||
else
|
else
|
||||||
Gizmos.color = TriggerCount > 0 ? Color.green : Color.red;
|
Gizmos.color = TriggerCount > 0 ? Color.green : Color.red;
|
||||||
|
|
||||||
|
|
|
@ -45,5 +45,17 @@ namespace Syntriax.Modules.Trigger
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if UNITY_EDITOR
|
||||||
|
private State.IStateEnable stateEnable = null;
|
||||||
|
public State.IStateEnable StateEnable
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
stateEnable = stateEnable ?? GetComponent<State.IStateEnable>() ?? gameObject.AddComponent<State.StateEnableMonoBehaviour>();
|
||||||
|
return stateEnable;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue