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