同步
This commit is contained in:
@@ -45,16 +45,44 @@ namespace Ichni.RhythmGame
|
||||
public override void AfterInitialize()
|
||||
{
|
||||
base.AfterInitialize();
|
||||
// 注册 Phase 7(Effect),确保在 Track/TrackFollower(Phase 4/5)和 Note(Phase 6)
|
||||
// 全部更新完毕后再计算旋转覆盖,避免因位置尚未就绪导致的旋转抖动
|
||||
CoreServices.UpdateScheduler.Register(UpdatePhase.Effect, this);
|
||||
}
|
||||
|
||||
public override void OnDelete()
|
||||
{
|
||||
base.OnDelete();
|
||||
CoreServices.UpdateScheduler.Unregister(UpdatePhase.Effect, this);
|
||||
}
|
||||
|
||||
public override void ManualUpdate(float songTime, bool forceUpdate = false)
|
||||
{
|
||||
base.ManualUpdate(songTime, forceUpdate);
|
||||
// 动画结束时同步注销 Phase 7
|
||||
if (timeDurationSubmodule.CheckAfterEndTime(songTime))
|
||||
{
|
||||
CoreServices.UpdateScheduler.Unregister(UpdatePhase.Effect, this);
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region [核心动画逻辑] Core Animation Logic
|
||||
void LateUpdate()
|
||||
public override void ScheduledUpdate(UpdatePhase phase, float songTime)
|
||||
{
|
||||
if (enabling.value)
|
||||
switch (phase)
|
||||
{
|
||||
(animatedObject as IHaveTransformSubmodule)?.UpdateLookAt(this);
|
||||
case UpdatePhase.Animation:
|
||||
base.ScheduledUpdate(phase, songTime);
|
||||
break;
|
||||
case UpdatePhase.Effect:
|
||||
// 在所有 Track/TrackFollower/Note 位置更新完毕后覆盖旋转
|
||||
if (enabling.value)
|
||||
{
|
||||
(animatedObject as IHaveTransformSubmodule)?.UpdateLookAt(this);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user