Files
Workspace/Assets/Demos/Demo2/Mods/NightShiftProtocol/UnityAdapter/NightShiftUnityMod.cs
T
2026-08-18 02:03:34 +08:00

31 lines
1.1 KiB
C#

#nullable enable
using Demo2.Runtime;
using ShrinkCommand;
using ShrinkModFramework;
namespace NightShiftProtocol
{
[ShrinkMod("example.night-shift-protocol", "夜班协议", "1.0.0", AutoApplyHarmonyPatches = false)]
public sealed class NightShiftUnityMod : ShrinkModBase
{
public override void OnRegisterContent(ShrinkModContext context)
{
context.GetRegistry<Demo2.Domain.IDemo2Mod>(Demo2ModBridge.RegistryName)
.Register(context.ModInfo.ModId, context.ModInfo.ModId, new NightShiftContent());
}
public override void OnReady(ShrinkModContext context)
{
context.Log("Night-shift content registered without per-item callbacks or Harmony ECS patches.");
}
}
[ShrinkCommandSubscriber]
public static class NightShiftServerCommands
{
[ShrinkCommand("demo2 night-shift status", Description = "显示夜班协议加载状态", Permission = "demo2.mods.inspect")]
private static string Status() => "night-shift-protocol=registered; appliesTo=next-cycle-or-next-game";
}
}