feat: add Godot C# compatibility and shared codegen weaving
Validate ShrinkSDK Workspace / unity (push) Failing after 3m18s
Validate ShrinkSDK Workspace / unity (push) Failing after 3m18s
This commit is contained in:
@@ -0,0 +1,49 @@
|
||||
#nullable enable
|
||||
|
||||
using Godot;
|
||||
using ShrinkTutorial;
|
||||
using ShrinkTutorial.Godot;
|
||||
|
||||
public partial class TutorialDemo : Control
|
||||
{
|
||||
public override void _Ready()
|
||||
{
|
||||
var target = new Button
|
||||
{
|
||||
Text = "Tutorial Target",
|
||||
Position = new Vector2(480, 260),
|
||||
CustomMinimumSize = new Vector2(220, 72)
|
||||
};
|
||||
target.AddToGroup("shrink_tutorial_primary");
|
||||
AddChild(target);
|
||||
|
||||
var overlay = new ShrinkGodotTutorialOverlay();
|
||||
AddChild(overlay);
|
||||
var runner = new ShrinkTutorialRunner(new MemoryTutorialStorage());
|
||||
runner.Start(new ShrinkTutorialData
|
||||
{
|
||||
TutorialId = "visual-smoke",
|
||||
Steps =
|
||||
{
|
||||
new ShrinkTutorialStep
|
||||
{
|
||||
StepId = "target",
|
||||
Title = "Godot Tutorial",
|
||||
Body = "Target hole, dialog and input blocker smoke test",
|
||||
TargetMode = ShrinkTutorialTargetMode.AnchorId,
|
||||
Target = "primary",
|
||||
CompleteCondition = ShrinkTutorialCompleteCondition.ClickTarget
|
||||
}
|
||||
}
|
||||
});
|
||||
overlay.Bind(runner);
|
||||
GetTree().CreateTimer(2).Timeout += QuitCleanly;
|
||||
}
|
||||
|
||||
private void QuitCleanly()
|
||||
{
|
||||
var tree = GetTree();
|
||||
tree.UnloadCurrentScene();
|
||||
tree.CreateTimer(0.1).Timeout += () => tree.Quit(0);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user