同步
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user