From c90babd99b13c4d6ac7c81f95bf0a48b8d4f14b7 Mon Sep 17 00:00:00 2001 From: Gregory Labute Date: Thu, 30 May 2024 11:27:19 -0400 Subject: [PATCH] Don't draw twisted railroad tracks if spline roll is disabled --- .../Editor/Editors/CinemachineSplineRollEditor.cs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/com.unity.cinemachine/Editor/Editors/CinemachineSplineRollEditor.cs b/com.unity.cinemachine/Editor/Editors/CinemachineSplineRollEditor.cs index 0811e3d58..93600729b 100644 --- a/com.unity.cinemachine/Editor/Editors/CinemachineSplineRollEditor.cs +++ b/com.unity.cinemachine/Editor/Editors/CinemachineSplineRollEditor.cs @@ -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; @@ -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 @@ -147,6 +149,7 @@ class SplineGizmoCache public Spline Spline; public float Width; public int Resolution; + public bool Enabled; public static SplineGizmoCache Instance;