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 enter a complete API identifier.

Browse the reference instead

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

v0.89.0
Menu

C# is the truth

Why Round Trip writes ordinary C# instead of its own format, and how source, visual drafts and graph configuration stay in one safe round trip.

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 graph. Visual edits are drafts until you press Compile. Compile updates the C# file and Round Trip parses it again. No parallel executable graph format needs syncing, and a game built on the canvas compiles without the package installed.

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.

What happens when Compile writes a graph draftFour stations show a draft in memory moving through Compile, one changed C# line, and a re-parsed graph. 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)2Compilevalidate the plan3Smallest editto the .cs- AddCoins(1) + AddCoins(2)4Re-parsegraph from sourceplaceholder noderefuses, file unchangedsource unchanged except one lineWhat happens when Compile writes a graph draftFour stations show a draft in memory moving through Compile, one changed C# line, and a re-parsed graph. 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)2Compilevalidate the plan3Smallest editto the .cs- AddCoins(1) + AddCoins(2)4Re-parsegraph from sourceplaceholder noderefuses, file unchangedsource unchanged except one line
A visual edit becomes a draft. Compile splices the smallest safe source change, writes atomically, then re-parses the result.
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 graph configuration file Node positions and viewport, reroute knots, split or merged reads, collapse state and comment popup placement. It changes how the source-derived graph 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 graph appearance and interaction preferences, including theme, canvas, zoom, grid, routing and edge visuals.

Local graph configuration lives under <Project>/UserSettings/RoundTrip. Shared graph configuration lives under <Project>/RoundTrip.

If the file sits under Assets, Unity’s import and refresh path invalidates the index. Round Trip reads the new file, rebuilds the selected method graph and replaces source-derived nodes with what the code now says.

Configured source roots outside the Unity project use recursive file watchers. Changes to C# files are deduplicated and scheduled after 150 ms. If Unity is compiling or importing, the refresh waits and retries. Returning focus to the editor also checks for changes.

The open graph 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 structural graph change may regenerate a method body. The writer reads the current file and performs an atomic overwrite. It imports the result and re-indexes it, then parses it again.

The re-parse matters. The graph 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 and the draft stays recoverable. The message names the file:

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

Let the graph 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