将Spline移出Plugin,以调整SplineRenderer的OnWillCameraRender
This commit is contained in:
@@ -12,6 +12,7 @@ namespace Ichni.RhythmGame
|
||||
public partial class TrackPathSubmodule : TrackSubmodule
|
||||
{
|
||||
public SplineComputer path;
|
||||
public SplineRenderer trackDisplay;
|
||||
public List<PathNode> pathNodeList;
|
||||
|
||||
public Track.TrackSpaceType trackSpaceType;
|
||||
@@ -21,6 +22,7 @@ namespace Ichni.RhythmGame
|
||||
public TrackPathSubmodule(Track track, Track.TrackSpaceType trackSpaceType, Track.TrackSamplingType trackSamplingType, bool isClosed) : base(track)
|
||||
{
|
||||
this.path = track.AddComponent<SplineComputer>();
|
||||
|
||||
this.track.trackPathSubmodule = this;
|
||||
this.pathNodeList = new List<PathNode>();
|
||||
this.trackSpaceType = trackSpaceType;
|
||||
@@ -29,6 +31,10 @@ namespace Ichni.RhythmGame
|
||||
|
||||
SetUpSplineComputer(this.trackSpaceType, this.trackSamplingType);
|
||||
//闭合路径在PathNode生成时执行,在初始化的情况下,PathNode数量为0,不会执行闭合操作
|
||||
|
||||
this.trackDisplay = UnityEngine.Object.Instantiate(EditorManager.instance.basePrefabs.trackDisplay, track.transform).GetComponent<SplineRenderer>();
|
||||
this.trackDisplay.spline = path;
|
||||
this.trackDisplay.size = 0.1f;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user