Files
aibis-dream/Assets/Scripts/SaveSystem/SnapshotBootstrap.cs
T

27 lines
991 B
C#

namespace AibisDream.SaveSystem
{
/// <summary>
/// 一次性注册 P1 所需的全部 <see cref="ISnapshotProvider"/>。
/// 由 <see cref="YarnVariableStorage"/> 与 <see cref="SnapshotService"/> 在首次使用时调用。
/// </summary>
public static class SnapshotBootstrap
{
private static bool _initialized;
/// <summary>幂等;重复调用无副作用。</summary>
public static void EnsureInitialized()
{
if (_initialized) return;
_initialized = true;
SnapshotRegistry.Register(new EnvironmentSnapshotProvider());
SnapshotRegistry.Register(new ActorSnapshotProvider());
SnapshotRegistry.Register(new AudioSnapshotProvider());
SnapshotRegistry.Register(new TimelineSnapshotProvider());
SnapshotRegistry.Register(new FixSnapshotProvider());
SnapshotRegistry.Register(new ScreenSnapshotProvider());
}
}
}