Skip to content
a happy white dog smiling over the soft logotype text '2dog'

All right, let's cook! โ€‹

csharp
using twodog;

using var engine = new Engine("myapp", "./project");
using var godot = engine.Start();

// Load a scene
var scene = GD.Load<PackedScene>("res://game.tscn");
engine.Tree.Root.AddChild(scene.Instantiate());

// Run the main loop
while (!godot.Iteration())
{
    // Your code here  -  every frame
}
csharp
using twodog.fixture;
using twodog.xunit;

[Collection<GodotHeadlessCollection>]
public class GodotSceneTests(GodotHeadlessFixture godot)
{
    [Fact]
    public void LoadScene_ValidPath_Succeeds()
    {
        var scene = GD.Load<PackedScene>("res://game.tscn");
        var instance = scene.Instantiate();
        
        godot.Tree.Root.AddChild(instance);
        
        Assert.NotNull(instance.Parent);
    }
}
csharp
// With the editor native variant (TwoDogVariant=editor),
// TOOLS_ENABLED code paths and [Tool] scripts are active.

using twodog;

using var engine = new Engine("tool", "./project", "--headless");
using var godot = engine.Start();

// Drive the scene tree from your own code:
// batch processing, validation, custom tooling.
var scene = GD.Load<PackedScene>("res://main.tscn");
godot.Tree.Root.AddChild(scene.Instantiate());

Installation โ€‹

bash
# Install template
dotnet new install 2dog

# Create your Project
dotnet new 2dog -n LetsCook

cd LetsCook

# Assets are imported automatically during build
dotnet run --project LetsCook

# Optionally, open and edit the project in the Godot Editor
godot-mono -e --path LetsCook.Godot
bash
dotnet add package 2dog
dotnet add package 2dog.xunit