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

@@ -1,25 +1,31 @@
namespace Ichni.RhythmGame
{
/// <summary>
/// 轻量级核心服务定位器,允许游戏编辑器分别注册自己的时间引擎
/// 轻量级核心服务定位器,允许游戏本体与谱面编辑器分别注册自己的时间引擎
/// </summary>
public static class CoreServices
{
public static ISongTimeProvider TimeProvider { get; set; }
/// <summary>
/// 集中式元素更新调度器。
/// 所有 GameElement 子类应通过此属性访问调度器进行 Register / Unregister
/// 而非直接引用 EditorManager 或 GameManager。
/// </summary>
public static ElementUpdateScheduler UpdateScheduler { get; set; }
}
/// <summary>
/// 全局时间供应器接口
/// 无论是在游戏本体还是在谱面编辑器,一切与时间强相关的运作(特效、生成、判定
/// 全局时间供应器接口
/// 无论是在游戏本体还是在谱面编辑器,一切与时间强相关的运作(特效、动画、生成)
/// 只能依赖此接口,严禁直接调用 GameManager
/// </summary>
public interface ISongTimeProvider
{
/// <summary>当前音频的播放进度时间 (秒)</summary>
/// <summary>当前音频的播放进度时间(秒),已扣除 offset</summary>
float SongTime { get; }
/// <summary>当前时间轴是否处于流转播放状态</summary>
bool IsPlaying { get; }
}
}
}

View File

@@ -0,0 +1,22 @@
namespace Ichni.RhythmGame
{
/// <summary>
/// 所有参与集中更新调度的元素需实现的接口。
/// 同一元素可注册到多个 <see cref="UpdatePhase"/>
/// 通过 <paramref name="phase"/> 参数区分当前所处阶段并执行对应逻辑。
/// </summary>
public interface IScheduledElement
{
/// <summary>
/// 由 <see cref="ElementUpdateScheduler"/> 在对应阶段调用。
/// </summary>
/// <param name="phase">当前执行的更新阶段</param>
/// <param name="songTime">当前音频播放时间(秒)</param>
void ScheduledUpdate(UpdatePhase phase, float songTime);
/// <summary>
/// 元素是否处于活跃状态。调度器跳过非活跃元素以节省开销。
/// </summary>
bool IsScheduledActive { get; }
}
}

View File

@@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: 8b0489cd9b9f44b4f9a7c73cf2b07de2