public void DrawGizmos(IDebuggableConstraint.DrawGizmosSettings settings) { Vector2 normal = m.normal; void Draw(Vector2 contact, int id) { id = math.abs(id); Gizmos.color = new Color( (id % 4591 % 256) / 256.0f, (id % 5347 % 256) / 265.0f, (id % 3797 % 256) / 265.0f); Gizmos.DrawRay(contact, normal); Gizmos.DrawSphere(contact, .05f); } if (useContact1) { Draw(m.contact1.point, m.contact1.id); } else { Draw(m.contact2.Value.point, m.contact2.Value.id); } }
public void DrawGizmos(IDebuggableConstraint.DrawGizmosSettings settings) { Vector2 m1 = x1 + (Vector2)m.r1; Vector2 m2 = x2 + (Vector2)m.r2; Gizmos.color = settings.color; Gizmos.DrawLine(x1, m1); Gizmos.DrawSphere(m1, settings.drawRadius); Gizmos.color = settings.springStretchColor; Gizmos.DrawLine(m1, m2); Gizmos.color = settings.color; Gizmos.DrawLine(x2, m2); Gizmos.DrawSphere(m2, settings.drawRadius); }