void OnDrawGizmos() { if (script == null) { script = GetComponent <ProceduralTileScript>(); } else { originPoint = transform.position + script.GetCalculatedOffset(); Gizmos.color = new Color(0, 0, 1); Gizmos.DrawSphere(originPoint, 0.1f); Gizmos.DrawLine(originPoint + script.GetCalcularedDisRight(), originPoint + script.GetCalcularedDisRight() + Vector3.down * (script.GetHeight() * 2 + 0.4f)); Gizmos.DrawLine(originPoint + script.GetCalcularedDisForward(), originPoint + script.GetCalcularedDisForward() + Vector3.down * (script.GetHeight() * 2 + 0.4f)); Gizmos.DrawLine(originPoint - script.GetCalcularedDisRight(), originPoint - script.GetCalcularedDisRight() + Vector3.down * (script.GetHeight() * 2 + 0.4f)); Gizmos.DrawLine(originPoint - script.GetCalcularedDisForward(), originPoint - script.GetCalcularedDisForward() + Vector3.down * (script.GetHeight() * 2 + 0.4f)); } }
void OnDrawGizmos() { if (script == null) { script = GetComponent <ProceduralTileScript>(); } else { if (script.GetPlayer() != null) { if (distanceIndication && script.GetMinDis() < Mathf.Abs((script.GetPlayer().transform.position - (transform.position + script.GetCalculatedOffset())).magnitude)) { Gizmos.color = new Color(1, 0, 0); } else { Gizmos.color = new Color(1, 1, 0); } Gizmos.DrawLine(transform.position + script.GetCalculatedOffset(), script.GetPlayer().transform.position); } } }