This commit is contained in:
SoulliesOfficial
2026-06-05 04:45:57 -04:00
parent 3a63641a2c
commit 7c60c40d6b
377 changed files with 10970 additions and 843 deletions

View File

@@ -9,7 +9,7 @@ using UnityEngine;
namespace Ichni.RhythmGame
{
public partial class CrossTrackPoint : GameElement, IHaveTimeDurationSubmodule
public partial class CrossTrackPoint : GameElement, IHaveTimeDurationSubmodule, IScheduledElement
{
#region [] Essential Configs
public ElementFolder trackListFolder;
@@ -45,10 +45,16 @@ namespace Ichni.RhythmGame
public override void AfterInitialize()
{
GameManager.Instance.trackManager.RegisterCrossPoint(this);
CoreServices.UpdateScheduler.Register(UpdatePhase.TrackFollower, this);
base.AfterInitialize();
}
public override void OnDelete()
{
base.OnDelete();
CoreServices.UpdateScheduler.Unregister(UpdatePhase.TrackFollower, this);
}
public override void SetDefaultSubmodules()
{
timeDurationSubmodule = new TimeDurationSubmodule(this);
@@ -68,11 +74,20 @@ namespace Ichni.RhythmGame
trackPercent.returnType == FlexibleReturnType.After)
{
trackPositioner.SetPercent(1);
GameManager.Instance.trackManager.UnregisterCrossPoint(this);
CoreServices.UpdateScheduler.Unregister(UpdatePhase.TrackFollower, this);
}
}
}
#region [IScheduledElement] Scheduler Interface
public void ScheduledUpdate(UpdatePhase phase, float songTime)
{
ManualUpdate(songTime);
}
public bool IsScheduledActive => isActiveAndEnabled;
#endregion
private void SetPoint()
{
if (nowAttachedTrackIndex != trackSwitch.value &&
@@ -82,6 +97,7 @@ namespace Ichni.RhythmGame
nowAttachedTrack = trackListFolder.trackList[trackSwitch.value];
nowAttachedTrackIndex = trackSwitch.value;
trackPositioner.spline = trackListFolder.trackList[trackSwitch.value].trackPathSubmodule.path;
trackPositioner.RebuildImmediate();
}
trackPositioner.SetPercent(trackPercent.value);