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

@@ -5,7 +5,7 @@ using UnityEngine;
namespace Ichni.RhythmGame
{
public abstract partial class AnimationBase : GameElement, IHaveTimeDurationSubmodule
public abstract partial class AnimationBase : GameElement, IHaveTimeDurationSubmodule, IScheduledElement
{
#region [] Attributes & Related Objects
public GameElement animatedObject;
@@ -27,8 +27,7 @@ namespace Ichni.RhythmGame
{
base.AfterInitialize();
// 【新增】受管家管控
GameManager.Instance.animationManager.RegisterAnimation(this);
CoreServices.UpdateScheduler.Register(UpdatePhase.Animation, this);
float delay = GameManager.Instance.songInformation.delay;
if (timeDurationSubmodule.CheckTimeInDuration(-delay))
{
@@ -36,6 +35,12 @@ namespace Ichni.RhythmGame
}
}
public override void OnDelete()
{
base.OnDelete();
CoreServices.UpdateScheduler.Unregister(UpdatePhase.Animation, this);
}
/// <summary>
/// 更新动画
/// </summary>
@@ -51,10 +56,19 @@ namespace Ichni.RhythmGame
if (timeDurationSubmodule.CheckAfterEndTime(currentSongTime))
{
GameManager.Instance.animationManager.UnregisterAnimation(this);
CoreServices.UpdateScheduler.Unregister(UpdatePhase.Animation, this);
}
}
#region [IScheduledElement] Scheduler Interface
public virtual void ScheduledUpdate(UpdatePhase phase, float songTime)
{
ManualUpdate(songTime);
}
public bool IsScheduledActive => isActiveAndEnabled;
#endregion
/// <summary>
/// 施加时间偏移即移动所有Flexible参数的时间
/// </summary>