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.
On this page
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 lives where
Section titled “What lives where”| 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.
When the file changes in your IDE
Section titled “When the file changes in your IDE”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.
When you press Compile
Section titled “When you press Compile”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.
If the file changes during Compile
Section titled “If the file changes during Compile”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:
{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.
- Preview and Compile: follow the controls and status messages.
- Edits from outside: work between an IDE and the graph.
- Graph configuration files: choose local or shared layout storage.