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.xunit;

[Collection("GodotHeadless")]
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
// Build with: dotnet build -c Editor
// Enables TOOLS_ENABLED for import and editor features

using twodog;

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

// Import a texture with custom settings
var importer = ResourceImporterTexture.Singleton;
// Use Godot's full import pipeline
// Access editor-only APIs like EditorImportPlugin, EditorInterface, etc.

Installation โ€‹

bash
# Install template
dotnet new install 2dog

# Create your Project
dotnet new 2dog -n LetsCook

cd LetsCook

# Open and edit the project in Godot Editor or just run --import once
godot-mono --path LetsCook.Godot --import

dotnet run --project LetsCook
bash
dotnet add package 2dog
dotnet add package 2dog.xunit