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

Change it visually, then Compile

Replace one wired value in CollectCoin, preview the draft, and write one focused C# change.

One coin currently adds CoinsPerPickup. For a quick experiment, make that call add two coins and watch the source change only when you ask it to.

PlayerController.CollectCoin passes a named constant into ScoreCounter.AddCoins. The input pin is wired, so it has no literal box to edit. You need to remove that data wire before a number can live on the pin itself.

  • You want to test a different argument without rewriting the whole method.
  • A call already exists and only one input value should change.
  • You want a draft you can undo before it touches source.
The CollectCoin graph with its guard and four neighbor calls.
Figure 1. The AddCoins call receives its value from the CoinsPerPickup constant pill.
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 canvas edit stays in the draft, Compile splices it into C#, and the next graph is parsed from that C#.
  1. Open the Platformer project and Tools > Round Trip > Graph View. Press Cmd/Ctrl+K, choose PlayerController, then select CollectCoin.

  2. Find the AddCoins call. Its count input is wired from the CoinsPerPickup pill. A wired pin shows the connected value and does not offer literal entry.

  3. Hold Alt and left-click the colored data wire between CoinsPerPickup and count. Alt-click on a wire performs the same edit as its Break Link context action. The count pin becomes unwired.

  4. Click the now-unwired count pin. Its inline literal editor opens. Type 2, then press Enter or click away to commit the value.

  5. Read the panel pinned to the top of the right rail: Previewing your changes. It counts the edits that are not in the C# yet and carries Undo. The toolbar Compile turns amber, which means the graph has a draft. Open PlayerController.cs now and the source still passes CoinsPerPickup.

The Previewing your changes panel with the toolbar Compile ready.
Figure 2. The new literal exists in the draft before it exists in C#.
  1. Press Compile in the toolbar. Round Trip validates the pending wire and literal edits, writes the source, imports the file, and parses the method again.

  2. Open PlayerController.cs and find the AddCoins line. The receiver and method are unchanged. Only the argument now reads 2.

  3. Return to the graph after Unity finishes compiling. The count pin shows the literal 2, because the graph has been rebuilt from the written method.

Before Compile, use Cmd/Ctrl+Z. Undo restores the literal edit first and then the broken wire as you step backward through the draft history. The .cs file is untouched during those undo steps.

After Compile, the graph has already been re-parsed from source, so use version-control history. Right-click the changed method and choose Revert Method. That action is available for a modified, added, or renamed method when version control is detected. It restores the whole method from the configured baseline, normally HEAD, so inspect the diff first if the method contains other edits you want to keep.

When it goes wrong

SymptomCheckFix
Clicking the count pin does not open a value box.Look for a colored wire still attached to the pin.Alt-click that wire or use Break Link, then click the unwired pin.
Compile stays disabled after entering 2.Confirm the editor committed the value and no pin value is invalid.Press Enter, then hover the toolbar Compile; its tooltip says when a pending change needs attention.
The source still shows CoinsPerPickup.Look for the Previewing your changes banner.Press Compile and wait for Unity to finish importing the file.
Revert Method is disabled.Confirm version control is detected and the method has a changed status.Use ordinary source editing to restore the line, or configure version control before using method history actions.
Full-size image