feat: integrate composable Godot runtime and EventBus debugger

This commit is contained in:
cneicy committed 2026-11-06 19:18:54 +08:00
1 parent 0d9e04c09d
commit 51f8a1d044
55 files changed
+1481 -114

No files matched your search

@@ -12,9 +12,10 @@ using ShrinkDataSaver;
using ShrinkEventBus;
using ShrinkNetwork;
using ShrinkSDK.Godot;
using ShrinkSDK.EntJoy.Godot;
using ShrinkTutorial;
public partial class SampleRoot : ShrinkGodotHost
public partial class SampleRoot : ShrinkEntJoyHost
{
public override void _Ready()
{
@@ -24,6 +25,10 @@ public partial class SampleRoot : ShrinkGodotHost
private async UniTaskVoid RunSmokeAsync()
{
if (EntJoyWorld == null)
throw new InvalidOperationException("EntJoy world was not created by ShrinkEntJoyHost.");
var smokeEntity = EntJoyWorld.EntityManager.NewEntity(typeof(GodotEntJoySmokeComponent));
EntJoyWorld.EntityManager.Set(smokeEntity, new GodotEntJoySmokeComponent { Value = 42 });
var marker = RequireWoven(GetType().Assembly);
var goldenPath = ProjectSettings.GlobalizePath("res://../../../Assets/AgentSupportTests/Runtime/Resources/ShrinkV2Golden.bytes");
var golden = System.IO.File.ReadAllBytes(goldenPath);
@@ -60,7 +65,10 @@ public partial class SampleRoot : ShrinkGodotHost
});
var tutorialCompleted = tutorial.CompleteStep();
await ToSignal(GetTree(), SceneTree.SignalName.ProcessFrame);
await ToSignal(GetTree(), SceneTree.SignalName.ProcessFrame);
if (GodotSubscriber.Calls != 1 || GodotStaticSubscriber.Calls != 1 || savedValue != 42 ||
EntJoyWorld == null || EntJoyWorld.CurrentFrame < 1 ||
!app.IsRunning || !GodotInstaller.Initialized ||
activeFibers != 3 || !tutorialStarted || !tutorialCompleted || !tutorialStorage.Saved ||
!registries.Contains(nameof(ShrinkCommandStaticRegistryAttribute)) ||
@@ -91,6 +99,11 @@ public sealed class MemoryTutorialStorage : IShrinkTutorialStorage
public readonly struct GodotSmokeEvent : IShrinkEvent { }
public struct GodotEntJoySmokeComponent : EntJoy.ECS.IComponentData
{
public int Value;
}
[ShrinkEventSubscriber]
public sealed class GodotSubscriber
{