Skip to content

Commit

Permalink
Don't draw twisted railroad tracks if spline roll is disabled
Browse files Browse the repository at this point in the history
  • Loading branch information
glabute committed May 30, 2024
1 parent cedfb6c commit c90babd
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,8 @@ static void DrawSplineGizmo(CinemachineSplineRoll splineRoll, Color pathColor, f
|| SplineGizmoCache.Instance.Spline != splineContainer.Spline
|| SplineGizmoCache.Instance.RollData != splineRoll.Roll
|| SplineGizmoCache.Instance.Width != width
|| SplineGizmoCache.Instance.Resolution != resolution)
|| SplineGizmoCache.Instance.Resolution != resolution
|| SplineGizmoCache.Instance.Enabled != splineRoll.enabled)
{
var numKnots = splineContainer.Spline.Count;
var numSteps = numKnots * resolution;
Expand Down Expand Up @@ -126,7 +127,8 @@ static void DrawSplineGizmo(CinemachineSplineRoll splineRoll, Color pathColor, f
Spline = splineContainer.Spline,
RollData = splineRoll.Roll,
Width = width,
Resolution = resolution
Resolution = resolution,
Enabled = splineRoll.enabled
};
}
// Draw the path
Expand All @@ -147,6 +149,7 @@ class SplineGizmoCache
public Spline Spline;
public float Width;
public int Resolution;
public bool Enabled;

public static SplineGizmoCache Instance;

Expand Down

0 comments on commit c90babd

Please sign in to comment.