feat(sdk): migrate to EventBus 2.0
Replace the legacy EventBase runtime with generated multi-bus bindings and explicit scheduling. Migrate app, data, network, demo, and mod consumers; add generated network-event registration and owner-scoped mod content overrides.
This commit is contained in:
@@ -54,7 +54,7 @@ namespace ShrinkApp
|
||||
{
|
||||
HasFailed = true;
|
||||
LastError = ex.Message;
|
||||
EventBus.TriggerEvent(new ShrinkAppStartFailedEvent
|
||||
EventBus.Post(new ShrinkAppStartFailedEvent
|
||||
{
|
||||
ErrorMessage = ex.Message,
|
||||
FailedModuleId = _startedModules.LastOrDefault() ?? string.Empty
|
||||
@@ -75,7 +75,7 @@ namespace ShrinkApp
|
||||
return;
|
||||
|
||||
_publishedStartedEvent = true;
|
||||
EventBus.TriggerEvent(new ShrinkAppStartedEvent
|
||||
EventBus.Post(new ShrinkAppStartedEvent
|
||||
{
|
||||
ModuleIds = _startedModules.ToArray()
|
||||
});
|
||||
|
||||
@@ -168,12 +168,12 @@ namespace ShrinkApp
|
||||
public ShrinkAppHostingMode hostingMode = ShrinkAppHostingMode.ClassicHost;
|
||||
}
|
||||
|
||||
public sealed class ShrinkAppStartedEvent : EventBase
|
||||
public sealed class ShrinkAppStartedEvent : IShrinkEvent
|
||||
{
|
||||
public IReadOnlyList<string> ModuleIds { get; set; } = Array.Empty<string>();
|
||||
}
|
||||
|
||||
public sealed class ShrinkAppStartFailedEvent : EventBase
|
||||
public sealed class ShrinkAppStartFailedEvent : IShrinkEvent
|
||||
{
|
||||
public string ErrorMessage { get; set; } = string.Empty;
|
||||
public string FailedModuleId { get; set; } = string.Empty;
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
"description": "Shrink 系列统一宿主层,提供模块安装器、服务容器与统一启动流程。",
|
||||
"unity": "2022.3",
|
||||
"dependencies": {
|
||||
"com.cneicy.shrink-eventbus": "1.3.0",
|
||||
"com.cneicy.shrink-eventbus": "2.0.0",
|
||||
"com.cneicy.shrink-shared-codegen": "0.1.0",
|
||||
"com.cysharp.unitask": "2.5.10"
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user