Skip to content

Instantly share code, notes, and snippets.

@unity3dcollege
Created May 27, 2017 17:59
Show Gist options
  • Save unity3dcollege/9b7fcc06055f1608740a13614992eed6 to your computer and use it in GitHub Desktop.
Save unity3dcollege/9b7fcc06055f1608740a13614992eed6 to your computer and use it in GitHub Desktop.
private void OnDrawGizmos()
{
#if UNITY_EDITOR
var wave = GetComponentInParent<Wave>();
var name = string.Format("{0}\r\n{1}", wave != null ? wave.name : "NOWAVE", gameObject.name);
bool isSelectedWave = transform.IsInCurrentSelectedWave();
Gizmos.color = isSelectedWave ? Color.green : Color.gray;
Gizmos.DrawSphere(transform.position, 0.5f);
if (isSelectedWave)
GizmosUtils.DrawText(GUI.skin, name, transform.position + Vector3.up, Color.green, 14, 5f);
#endif
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment