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

This commit is contained in:
2026-08-26 02:50:01 +08:00
commit b00f0b3684
20 changed files with 388 additions and 0 deletions
@@ -0,0 +1,14 @@
{
"name": "ShrinkContext.EventBusAdapter.Runtime",
"rootNamespace": "ShrinkContext.EventBusAdapter",
"references": [
"ShrinkContext.Core.Runtime",
"ShrinkEventBus.Runtime",
"UniTask"
],
"includePlatforms": [],
"excludePlatforms": [],
"allowUnsafeCode": false,
"overrideReferences": false,
"autoReferenced": false
}
@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: edea41497d7034e4c970a7368a156da4
AssemblyDefinitionImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
+33
View File
@@ -0,0 +1,33 @@
#nullable enable
using System;
using Cysharp.Threading.Tasks;
using ShrinkContext;
using ShrinkEventBus;
namespace ShrinkContext.EventBusAdapter
{
/// <summary>
/// 把生成的 ShrinkEventBus 绑定包装为可逆效应。
/// </summary>
public static class ShrinkEventBusEffects
{
/// <summary>
/// 激活生成的 [ShrinkSubscribe] 绑定,并在 Context 回滚时统一释放。
/// </summary>
public static ShrinkEffectHandle EffectAttach(this ShrinkCtx ctx, object target,
ShrinkBusKey? defaultBus = null)
{
if (ctx == null)
throw new ArgumentNullException(nameof(ctx));
if (target == null)
throw new ArgumentNullException(nameof(target));
var binding = EventBus.Attach(target, defaultBus);
return ctx.EffectInverse(() =>
{
binding.Dispose();
return UniTask.CompletedTask;
});
}
}
}
+11
View File
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: e897f289a1563c34eb3c992463f66fbc
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant: