This commit is contained in:
2025-05-30 19:37:54 +08:00
parent 82790c3d86
commit abd7cf3150
17 changed files with 779 additions and 135 deletions

View File

@@ -76,6 +76,12 @@ namespace Ichni.RhythmGame
node = new SplinePoint(position, Vector3.up, normal, size, color);
track.trackPathSubmodule.SetPathNode(this);
}
public void OnDestroy()
{
track.trackPathSubmodule.pathNodeList.Remove(this);
track.Refresh();
print("PathNode " + elementName + " destroyed.");
}
}
public partial class PathNode
@@ -98,10 +104,10 @@ namespace Ichni.RhythmGame
base.SetUpInspector();
var container = inspector.GenerateContainer("Path Node");
var pathNodeSettings = container.GenerateSubcontainer(3);
var indexText = inspector.GenerateHintText(this, pathNodeSettings, "Index: " + index);
var isShowingSphereToggle =
var isShowingSphereToggle =
inspector.GenerateToggle(this, pathNodeSettings, "Is Showing Sphere", nameof(isShowingSphere))
.AddListenerFunction(() => SetPathNodeSphere(isShowingSphere));
}

View File

@@ -1,6 +1,7 @@
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using Dreamteck.Splines;
using Ichni.Editor;
using Ichni.RhythmGame.Beatmap;
@@ -25,7 +26,7 @@ namespace Ichni.RhythmGame
Track.TrackSamplingType trackSamplingType, bool isClosed, bool isShowingDisplay) : base(track)
{
this.path = track.AddComponent<SplineComputer>();
this.pathNodeList = new List<PathNode>();
this.trackSpaceType = trackSpaceType;
this.trackSamplingType = trackSamplingType;
@@ -92,10 +93,6 @@ namespace Ichni.RhythmGame
public override void Refresh()
{
SetTrackSpaceType((int)trackSpaceType);
SetUpSplineComputer(trackSpaceType, trackSamplingType);

View File

@@ -116,6 +116,7 @@ namespace Ichni.RhythmGame
t.trailRenderer.emitting = emitting;
t.trailRenderer.enabled = emitting;
if (willClear) t.trailRenderer.Clear();
}
}
}