private void Temp(Color c, SplineNode node, SplineSegment segment) { int depth = segment.Depth(); if (depth == _depth | viewAllNodes) { if (segment.ChildCount <= 0) { Handles.color = c.Whitten(.3f); Handles.DrawDottedLine(node.PositionStart, segment.GlobalPosition(), 2f); Handles.color = c.Blacken(.3f); Handles.DrawLine(node.PositionEnd, segment.GlobalPosition()); } } foreach (SplineSegment child in segment.Children) { Temp(c, node, child); } }
private void RecursiveDrawSegment(SplineSegment segment) { foreach (SplineSegment child in segment.Children) { RecursiveDrawSegment(child); } int depth = segment.Depth(); Vector3 gPosition = segment.GlobalPosition(); Vector3 gScale = segment.GlobalPosition(); Quaternion gRotation = segment.GlobalRotation(); if (depth == _depth | viewAllNodes) { Gizmos.color = Palette.ColorWheel(segment.Depth(), 6); UnityEditor.Handles.color = Gizmos.color; UnityEditor.Handles.DrawWireDisc(gPosition, gRotation * Vector3.forward, 7f - depth); UnityEditor.Handles.DrawLine(gPosition, gPosition + segment.GlobalRotation() * (Vector3.forward * (depth + 1) * 5f)); //UnityEditor.Handles.Label(compareLocalGlobal ? segment.LocalPosition : segment.GlobalPosition(), segment.Depth().ToString()); UnityEditor.Handles.Label(segment.GlobalPosition() + Vector3.down * segment.Depth() * 10, "L:" + segment.LocalScale.ToString() + " G:" + segment.GlobalScale()); } }