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

@@ -8,7 +8,7 @@ using UnityEngine;
namespace Ichni.RhythmGame
{
public partial class TrackHeadPoint : GameElement, IHaveTimeDurationSubmodule
public partial class TrackHeadPoint : GameElement, IHaveTimeDurationSubmodule, IScheduledElement
{
#region [] Essential Configs
public Track track;
@@ -53,9 +53,15 @@ namespace Ichni.RhythmGame
public override void AfterInitialize()
{
GameManager.Instance.trackManager.RegisterHeadPoint(this);
CoreServices.UpdateScheduler.Register(UpdatePhase.TrackFollower, this);
base.AfterInitialize();
}
public override void OnDelete()
{
base.OnDelete();
CoreServices.UpdateScheduler.Unregister(UpdatePhase.TrackFollower, this);
}
#endregion
#region [] Main Update
@@ -68,9 +74,18 @@ namespace Ichni.RhythmGame
if(track.timeDurationSubmodule.CheckAfterEndTime(currentSongTime))
{
GameManager.Instance.trackManager.UnregisterHeadPoint(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
#endregion
}