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

Start here

Make Unity gameplay visually, review an AI's code as a diagram, or bring in scripts from anywhere. Everything stays ordinary C#.

Round Trip opens the C# methods in your own project as visual scripts. Take one example from the Platformer sample, a sample from the optional Round Trip Sample - Platformer package and that you can import into a test project to learn with. When the player touches a coin, PlayerController.CollectCoin checks that the coin is usable, collects it, updates the score and HUD, then asks the optional audio service to play a sound.

You can build a method like that on a canvas without typing a line. This is the method in the sample, as a diagram and as the C# Round Trip writes for it:

On the canvas the method is one guard branch followed by four calls, and the second check is listed on the method’s GUARDS card. It is still the same method in the same file. Your own methods look the same: Round Trip draws whatever C# sits in the folders you index. Build a method from nodes, read it, change it, or edit the C# in your IDE; each side follows the other.

Code and visual scripts in one loop, on PlayerController.CollectCoin in the Platformer sample: open the method, edit its C#, create a new method visually, then Compile the draft into the file.
Code and visual scripts in one loop, on PlayerController.CollectCoin in the Platformer sample: open the method, edit its C#, create a new method visually, then Compile the draft into the file.

The first time you choose Tools > Round Trip > Graph view, the Setup Wizard opens. It asks for the folders that hold your scripts, where to keep canvas layouts, and then builds the class index. Six screens, all changeable later.

The Round Trip setup wizard on the Platformer sample: Welcome, Sources, Layout, Guards, Review, and the built index.
The Round Trip setup wizard on the Platformer sample: Welcome, Sources, Layout, Guards, Review, and the built index.

The Setup Wizard walks through each screen. Install covers adding the package first.

  1. Pick a method. Choose a class in the Explorer on the left, then one of its methods. The canvas draws it from its C# file.
  2. Read it. White execution wires show the order things run. Colored data wires lead back to where each value comes from. Two kinds of wire explains the distinction in one page.
  3. Change it. Add a call from the action menu, type a literal onto a pin, or add a branch. Most canvas edits stay a draft until you press Compile. Guides.
  4. Compile. Round Trip writes the change into the real C# file in your project, then draws the diagram again from that file. After that, Undo cannot take it back; your last commit can. Or edit the C# in your IDE; the diagram follows. Compile.
  1. Top rail. The class picker and Compile, history and clipboard, the Align list and Auto layout, and the list of classes that changed since your last commit. The window
  2. Explorer. Every indexed class with its methods and variables. Click a method to open it. Explorer
  3. Canvas. The selected method as nodes and wires. This is where you read it and change it. Canvas
  4. Inspector. What the selected thing is: signature, comment, guards, pending changes. Identity and inspector
  5. Zoom and type legend. The current zoom and the color each C# type wears on pins and wires. Colors
Figure 2. The Round Trip graphs window on PlayerController.CollectCoin in the Platformer sample.

Build a method without typing code and press Compile for ordinary C# that needs nothing from Round Trip (Your first class). Open the methods an AI assistant changed as diagrams and decide whether to keep each change; save a checkpoint before the assistant starts, so you have something to go back to (Check what the AI did). Or add a folder of scripts from anywhere and read them visually before you change a line (Read a class you did not write). Three ways in has the longer version of each.

Round Trip writes C# and reads C# back, so you are never tied to the canvas. File edits are parsed into the diagram again. Visual edits stay as drafts until Compile writes the smallest source change it can.

C# and a Round Trip diagram staying synchronizedA four-phase loop between C# source and its diagram. First, a typed source line is parsed and its matching node lights. Next, the AddCoins literal changes from one to two as a draft and Compile becomes available. Compile sends the smallest source edit back to the C# panel. The final frame shows AddCoins two on both sides with an in sync chip.C# SOURCEvoid CollectCoin(Coin coin) { coin.Collect(); _scoreCounter.AddCoins(1); _scoreCounter.AddCoins(2);}Previewing your changes.Compilein syncMETHOD VIEWCollectCoinexeccoinCoinCollectexectargetexecScoreCounterAddCoinsexectargetcountexec12_scoreCounter1 · you typethe parser rebuilds the diagram2 · you dragthe diagram holds a draft3 · Compilethe smallest source edit is written4 · in syncsource and diagram agree againC# and a Round Trip diagram staying synchronizedA four-phase loop between C# source and its diagram. First, a typed source line is parsed and its matching node lights. Next, the AddCoins literal changes from one to two as a draft and Compile becomes available. Compile sends the smallest source edit back to the C# panel. The final frame shows AddCoins two on both sides with an in sync chip.C# SOURCEvoid CollectCoin(Coin coin) { coin.Collect(); _scoreCounter.AddCoins(1); _scoreCounter.AddCoins(2);}Previewing your changes.Compilein syncMETHOD VIEWCollectCoinexeccoinCoinCollectexectargetexecScoreCounterAddCoinsexectargetcountexec12_scoreCounter1 · you typethe parser rebuilds the diagram2 · you dragthe diagram holds a draft3 · Compilethe smallest source edit is written4 · in syncsource and diagram agree again
C# produces the diagram. A visual draft returns to C# only when you press Compile, then Round Trip parses the file again.
  • Install: add the package to your project.
  • The Setup Wizard: what each of its six screens asks for and saves.
  • What you get: the longer tour of the Explorer, canvas, authoring tools and Compile flow.
  • Three ways in: build without code, check an AI’s edit, or bring in existing scripts.
  • C# is the truth: see exactly what lives in source and what lives in configuration.
Full-size image