Skip to content
Bit Quirky Round Trip
Visual Scripting

Search documentation

All topics and APIs

Close returns focus to Search.

What are you looking for?

Try a common topic or a C# feature.

Browse the reference instead

Esc closes · Tab reaches results · Enter opens the focused link

v1.0.0
Menu

C# is the truth

Why Round Trip writes ordinary C# instead of its own format, and how source, visual drafts and layout files fit together.

Most visual scripting tools store your logic in their own asset format and run it through their own runtime. Leave the tool and the logic goes with it. Round Trip takes the other path: the C# file is authoritative. Round Trip parses that file to draw a diagram. Visual edits are drafts until you press Compile. Compile updates the real C# file in your project and Round Trip parses it again. No separate executable format needs syncing, and a game built on the canvas compiles without the package installed. Because the file is the truth, a mistake that reaches it is a mistake in your game, so protect your game files before you edit.

That is what lets you work in code, on the canvas, or both. A programmer can type in an IDE while a designer drags on the canvas, and the same file is what Unity compiles.

PlayerController.CollectCoin in the Platformer sample, built up one statement at a time: the entry node alone, then the coin guard, the Collect call, the AddCoins call, and the HUD refresh and coin sound.
PlayerController.CollectCoin in the Platformer sample, built up one statement at a time: the entry node alone, then the coin guard, the Collect call, the AddCoins call, and the HUD refresh and coin sound.

Each stage is parsed from C#: the picture is a view of the script, not a separate executable asset.

What happens when Compile writes a visual draftFour stations show a draft in memory moving through Compile, one changed C# line, and a diagram rebuilt from source. A token visits each station. A side path shows that a placeholder node is refused and leaves the file unchanged. The final frame holds the token at Re-parse and reports that the source is unchanged except for one line.1Draft(memory)2Compilecheck the draft3Smallest editto the .cs- AddCoins(1) + AddCoins(2)4Re-parseview from sourceplaceholder noderefuses, file unchangedsource unchanged except one lineWhat happens when Compile writes a visual draftFour stations show a draft in memory moving through Compile, one changed C# line, and a diagram rebuilt from source. A token visits each station. A side path shows that a placeholder node is refused and leaves the file unchanged. The final frame holds the token at Re-parse and reports that the source is unchanged except for one line.1Draft(memory)2Compilecheck the draft3Smallest editto the .cs- AddCoins(1) + AddCoins(2)4Re-parseview from sourceplaceholder noderefuses, file unchangedsource unchanged except one line
A visual edit becomes a draft. Compile writes the source change, then reads the saved code back into the diagram. Commit before the edit so you can go back.
Place What belongs there
C# file Classes and members, method bodies and comments, plus every behavior Unity compiles. This is the truth Round Trip reads.
.rt.json layout and configuration file Node positions and viewport, wire knots, split or merged reads, collapse state and comment popup placement. It changes how the diagram drawn from source is arranged.
ProjectSettings/RoundTripSettings.asset Team-wide include paths and layout storage scope, plus the version-control baseline and project behavior settings for guards, lifecycle recognition and Field defaults.
Unity EditorPrefs through Preferences > Round Trip Per-user appearance and interaction preferences, including theme, canvas, zoom, grid, wire routing and wire visuals.

Local layout and configuration files live under <Project>/UserSettings/RoundTrip. Shared files live under <Project>/RoundTrip.

If the file sits under Assets, Unity’s import and refresh process marks the index for updating. Round Trip reads the new file, rebuilds the selected method’s diagram and replaces the nodes drawn from source with what the code now says.

The open diagram therefore follows the file. A node or pill does not get to keep an older answer after the source has changed.

Round Trip validates the pending draft and chooses the smallest safe edit it can. A literal may replace one expression span. A rename may replace one identifier. A change to the visual script’s structure may regenerate a method body. The writer reads the current file and performs an atomic overwrite, replacing the file in one operation. It imports the result and re-indexes it, then parses it again.

The re-parse matters. The diagram after Compile is not a visual guess about what should have been written. It is a fresh view of the C# that reached disk.

Round Trip compares the file it planned against with the file on disk. If another tool changes it first, the write stops, the other tool’s change stays in the file, and your draft stays on the canvas unsaved. The message names the file:

{file} changed while compiling; discard and try Compile again.

Let the canvas reload the current source, discard the stale draft, make the visual edit again and press Compile. Round Trip does not merge two competing edits by guessing which one you meant.

Full-size image