ShrinkSDK

Public Unity SDK packages and workspace. yeah, almost AI slop. ;)

com.cneicy.shrink-command-integration-eventbus (0.2.5)

Published 2026-09-29 10:53:03 +08:00 by cneicy

Installation

registry=https://git.crash.work/api/packages/ShrinkSDK/npm/
npm install com.cneicy.shrink-command-integration-eventbus@0.2.5
"com.cneicy.shrink-command-integration-eventbus": "0.2.5"

About this package

ShrinkCommand 与 ShrinkEventBus 的桥接层,支持事件请求执行命令,以及命令执行生命周期事件发布。

ShrinkCommand.Integration.EventBus

ShrinkCommand 与 ShrinkEventBus 的桥接层。

Godot 和普通 .NET 项目安装 ShrinkSDK.Command.Integration.EventBus;可打包源码位于 DotNet~。

能力

  • 通过事件请求执行命令
  • 把命令执行过程发布为 EventBus 生命周期事件
  • 保持 ShrinkCommand 核心不依赖 ShrinkEventBus

事件

  • ShrinkCommandExecuteRequestEvent
  • ShrinkCommandExecutingEvent
  • ShrinkCommandExecutedEvent
  • ShrinkCommandFailedEvent

接入

ShrinkApp.Starter.Basic 的 ContextLoader 组合根会注册 ShrinkCommandEventBusComponent:它注入 shrink.service.command,激活时接桥,依赖撤回时自动拆桥。独立使用本包时再显式注册:

var service = new ShrinkCommandService();
service.AutoRegisterAll();
service.UseEventBusBridge(new ShrinkCommandEventBusBridgeOptions
{
    ServiceName = "default",
    DefaultSource = source
});

请求执行:

var result = await ShrinkCommandEventBusBridge.RequestCommandAsync("help", source);

可复用能力

Capability: 通过事件请求执行命令并发布结果 Aliases: 命令事件 结果反馈 command event Limits: 命令权限仍由 Command 校验;桥不增加新命令 Extension: 请求事件和桥接生命周期 Evidence: ShrinkCommandEventBusBridge

Dependencies

Dependencies

ID Version
com.cneicy.shrink-command 0.4.2
com.cneicy.shrink-context-core 0.3.0
com.cneicy.shrink-eventbus 2.2.2

Keywords

command eventbus integration bridge
Details
npm
2026-09-29 10:53:03 +08:00
2
cneicy
latest
4.8 KiB
Assets (1)
Versions (4) View all
0.2.5 2026-09-29
0.2.0 2026-09-05
0.1.2 2026-08-28
0.1.1 2026-08-26