chore: initialize standalone UPM package
Publish UPM package / publish (push) Failing after 1s

This commit is contained in:
2026-08-26 02:50:31 +08:00
commit 78ccae3e07
142 changed files with 6572 additions and 0 deletions
@@ -0,0 +1,18 @@
{
"name": "__ASMDEF_NAME__",
"rootNamespace": "__ROOT_NAMESPACE__",
"references": [
"ShrinkModFramework.Runtime",
"ShrinkEventBus.Runtime",
"ShrinkCommand.Runtime",
"ShrinkNetwork.Runtime"
],
"includePlatforms": [],
"excludePlatforms": [],
"allowUnsafeCode": false,
"overrideReferences": false,
"autoReferenced": true,
"defineConstraints": [],
"versionDefines": [],
"noEngineReferences": false
}
@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 9358a269a6e4a9740a69798dba1c1655
TextScriptImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,25 @@
#nullable enable
using ShrinkEventBus;
using ShrinkNetwork;
namespace __ROOT_NAMESPACE__
{
public sealed class __PROJECT_NAME__Event : IShrinkEvent
{
public string Message { get; set; } = string.Empty;
}
[ShrinkNetworkMessage(32001, "__MOD_ID__/ping")]
public sealed class __PROJECT_NAME__PingRequest : IShrinkNetworkRequest
{
public string Message { get; set; } = string.Empty;
}
[ShrinkNetworkMessage(32002, "__MOD_ID__/ping_response")]
public sealed class __PROJECT_NAME__PingResponse : ShrinkRpcResponseBase
{
public string Message { get; set; } = string.Empty;
public int Counter { get; set; }
}
}
@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 2dbfd0d836e24d84eabaff73259c7e90
TextScriptImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,66 @@
#nullable enable
using ShrinkCommand;
using ShrinkEventBus;
using ShrinkModFramework;
using ShrinkNetwork;
namespace __ROOT_NAMESPACE__
{
[ShrinkMod("__MOD_ID__", "__DISPLAY_NAME__", "1.0.0")]
[ShrinkEventSubscriber(OwnerId = "__MOD_ID__", DefaultBus = "mod:__MOD_ID__")]
[ShrinkCommandSubscriber]
[ShrinkNetworkSubscriber]
public sealed partial class __PROJECT_NAME__Mod : ShrinkModBase
{
private readonly RuntimeState _state = new();
public override void OnConstruct(ShrinkModContext context)
{
context.Log("模组已构造。");
}
public override void OnRegisterContent(ShrinkModContext context)
{
context.RegisterContent("example.items", "example_item", "__DISPLAY_NAME__ Item");
}
public override void OnInitialize(ShrinkModContext context)
{
context.RegisterNetworkHandler<int>("sync.counter", (_, value) =>
{
_state.Counter = value;
context.Log("收到模组网络计数:" + value);
});
}
[ShrinkSubscribe]
private void OnExampleEvent(__PROJECT_NAME__Event evt)
{
_state.LastEventMessage = evt.Message ?? string.Empty;
_state.Counter++;
}
[ShrinkCommand("__COMMAND_ROOT__ ping", Description = "测试模组命令", Permission = "__MOD_ID__.command.ping")]
private string Ping()
{
return "pong:" + _state.Counter;
}
[ShrinkNetworkSubscribe(Permission = "__MOD_ID__.rpc.ping")]
private __PROJECT_NAME__PingResponse HandlePing(__PROJECT_NAME__PingRequest request)
{
return new __PROJECT_NAME__PingResponse
{
Message = "pong:" + (request.Message ?? string.Empty),
Counter = _state.Counter
};
}
private sealed class RuntimeState
{
public int Counter { get; set; }
public string LastEventMessage { get; set; } = string.Empty;
}
}
}
@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 5e1319b1cd7dc0d4b918d12152b358ab
TextScriptImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant: