using System.Collections; using System.Collections.Generic; using Dreamteck.Splines; using Unity.VisualScripting; using UnityEngine; namespace Ichni.RhythmGame { public class TrackRendererSubmodule : TrackSubmodule { public Track track; public MeshGenerator meshGenerator; public MeshRenderer meshRenderer; } public class TrackRendererSubmoduleAutoOrient : TrackRendererSubmodule { public SplineRenderer splineRenderer; public void NewInitialize(Track track) { this.track = track; this.track.trackRendererSubmodule = this; this.splineRenderer = track.AddComponent(); this.meshGenerator = splineRenderer; this.splineRenderer.spline = track.trackPathSubmodule.path; this.splineRenderer.clipFrom = 0; this.splineRenderer.clipTo = 1; Debug.Log(splineRenderer.clipFrom + " " + splineRenderer.clipTo); this.splineRenderer.color = Color.white; } public override void InitialRefresh() { if (track.trackTimeSubmodule is TrackTimeSubmoduleMovable) { splineRenderer.clipFrom = 0; splineRenderer.clipTo = 0; } } } }