void OnDrawGizmos() { LineSegment target = new LineSegment(p1, p2); float centerOfMassDistance = (rb.worldCenterOfMass - rb.position).magnitude; Vector2 targetCenterOfMass = p1 + (p2 - p1).normalized * centerOfMassDistance; Gizmos.DrawLine(p1, p2); GizmosUtil.DrawConstantWidthSphere(targetCenterOfMass, .01f); }
private void OnDrawGizmosSelected() { GizmosUtil.DrawConstantWidthSphere(transform.TransformPoint(snapPoint), .025f); }