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

Read a class you did not write

Open a class you did not write in Graph view, follow its white and colored wires node by node, and confirm what you read in the right rail.

Someone else wrote a rule in your project. You can open it as a diagram and follow it node by node, and the same steps work for a tutorial script, a forum answer, or an asset you bought.

This page walks through the Platformer sample, a sample from the optional Round Trip Sample - Platformer package and that you import into a test project, so every step names a real class. There the rule is the goal door that opens after enough coins. The same steps apply to any project once its folder is indexed.

You need to answer one practical question about a class you did not write. In the Platformer sample, the class is ScoreCounter and the question is: what happens when the coin count changes? The answer runs through a guard, a rule node, a HUD update, and a final branch.

  • You dropped in a script from a tutorial, a forum answer, or the Asset Store and want to see what it does.
  • You inherited a Unity project and need to know what one behavior does before you change it.
  • A component’s name makes sense, but what it does on each event does not yet.
Pick the class, pick the method, read it visually: ScoreCounter.OnCoinCountChanged in the Platformer sample, from the Explorer to the first branch.
Pick the class, pick the method, read it visually: ScoreCounter.OnCoinCountChanged in the Platformer sample, from the Explorer to the first branch.
Reading a class from Explorer to diagram to identity headerThe Explorer rail lists Door, PlayerController, and ScoreCounter. A cursor picks ScoreCounter, then OnCoinCountChanged. The canvas reveals the method's diagram node by node along its execution wires. The right rail then fills with the identity OnCoinCountChanged and method, public, void metadata. The final frame shows all three panels.EXPLORERDoorPlayerControllerScoreCounterPUBLICAddCoinsAddScoreOnCoinCountChangedCANVASOnCoinCountChanged_rules == null || _door == nullRefreshStatus(false)ReturnShouldUnlockRefreshStatuscan open?UnlockIDENTITYOnCoinCountChangedmethod · public · voidReading a class from Explorer to diagram to identity headerThe Explorer rail lists Door, PlayerController, and ScoreCounter. A cursor picks ScoreCounter, then OnCoinCountChanged. The canvas reveals the method's diagram node by node along its execution wires. The right rail then fills with the identity OnCoinCountChanged and method, public, void metadata. The final frame shows all three panels.EXPLORERDoorPlayerControllerScoreCounterPUBLICAddCoinsAddScoreOnCoinCountChangedCANVASOnCoinCountChanged_rules == null || _door == nullRefreshStatus(false)ReturnShouldUnlockRefreshStatuscan open?UnlockIDENTITYOnCoinCountChangedmethod · public · void
Pick a class in the Explorer, choose one method, follow its diagram, then confirm what you read in the right rail.

Find the method and its details

Select a screenshot to enlarge it.

The full PlayerController window has CollectCoin selected between its two rails.
Figure 1. Orient yourself in the window These orientation captures use PlayerController. The steps below read ScoreCounter instead, in the same workspace.
PlayerController Lifecycle close-up has Awake and Update above two contact callbacks.
Figure 2. Look for the Unity starting points This orientation example uses PlayerController. Its Lifecycle rows show when Unity calls the script. The ScoreCounter used below has no such rows; that does not make it unused.
CollectCoin is highlighted under Methods > PUBLIC in the same PlayerController rail.
Figure 3. Find the task other code can call CollectCoin is a named task, rather than a Unity event. The walkthrough below opens OnCoinCountChanged in ScoreCounter in the same way.
Method identity shows public access and void return type. Its badge counts two guarded values above the source comment.
Figure 4. Confirm the selection on the right The method header reports public and void here. The guarded-values badge refers to this method, not every method in the class.

Read the method

  1. Add the source folder

    Open the project that holds the scripts; for this walkthrough, the test project with the Platformer sample. In the Project window, select the folder that holds the scripts (in the sample, Platformer/Runtime inside the imported sample folder) and choose Assets > Round Trip > Add folder to Round Trip. The folder joins the project’s source include paths. Round Trip has already done this for the Platformer sample, so you only need the step for your own scripts.

    In Unity, the Runtime folder is selected and the Assets menu opens Round Trip's Add folder to Round Trip command. The Assets menu, its Round Trip item and the Add folder to Round Trip command are each highlighted while the pointer is on them.
  2. Open Graph view

    Open Tools > Round Trip > Graph view. The Round Trip graphs window opens.

    The Unity Tools menu opens Round Trip's Graph view command and the Round Trip graphs window appears. The Tools menu, its Round Trip item and the Graph view command are each highlighted while the pointer is on them.
  3. Choose the class

    Press Cmd/Ctrl+O to open the class picker. In the sample, choose the Runtime scope, then select ScoreCounter from the list. The left rail fills with its Lifecycle, Methods and Variables.

    The class picker opens, its Runtime scope is selected, and ScoreCounter is chosen from the class list.
  4. Open the method

    Click the method you want to read. In the sample, click OnCoinCountChanged under PUBLIC. Start at the magenta entry node on the left and follow its white wire into the first yellow BRANCH node.

    ScoreCounter's OnCoinCountChanged is selected and highlighted in the left rail, with an arrow beside it; the entry node connects to the first branch.
  5. Read the condition

    Follow the red wire into the branch’s Condition back to where it starts. In the sample it comes from a red OR node fed by two red EQUALS nodes, each comparing a purple pill (_rules or _door) with null. Read it as “the rules or the door is missing”.

    The first branch condition comes from OR and two null comparisons of the rules and door pills.
  6. Follow the missing-input path

    Follow the branch’s true output. It reaches a teal RefreshStatus node, with HudPresenter above its title and its isGoalUnlocked box unticked, then a magenta EXIT node. That route shows the goal as locked and stops early.

    The first branch's true output reaches RefreshStatus with its isGoalUnlocked input abbreviated to …oalUnlocked, then EXIT.
  7. Follow the rule

    Go back to the branch and follow false. It reaches a dark teal ShouldUnlock node with CoinUnlockRule above its title. Green wires bring the Coins pill into coinCount and the coinUnlockThreshold pill into threshold. Its red bool output fills the navy shouldUnlock SET node, which has local bool under its name: the method keeps the rule’s answer under that name.

    The false output reaches ShouldUnlock, fed by Coins and coinUnlockThreshold, and its result goes to shouldUnlock.
  8. Follow the final branch

    Keep following the white wire. A second RefreshStatus node takes an OR of the shouldUnlock value and the red IsUnlocked pill read from _door. The last yellow BRANCH node takes shouldUnlock as its Condition, and only its true output reaches the door’s Unlock node, whose Target comes from _door.

    The second RefreshStatus receives the OR result; the last branch follows shouldUnlock to the door's call.
  9. Check the method and inspect a node

    With the method selected in the left rail, look at the top of the right rail, then click any node on the canvas. The identity header switches to that node, with its own details below it. Click empty canvas and then the method’s row to bring the method back.

    Clip: a branch is selected to show node details, then empty canvas and the method row restore the method identity. The identity header at the top of the right rail is highlighted with an arrow beside it.
    The method identity header names ScoreCounter.OnCoinCountChanged and shows public and void.
The OnCoinCountChanged diagram in the Platformer sample, with its guard and threshold branch.
Figure 5. Platformer sample: white wires show the order nodes run in; red wires carry yes or no values; green wires carry numbers from pills such as Coins and coinUnlockThreshold.

If you also read C#, double-click the method’s row or the method title in the toolbar to open its script at the method. Accessor rows offer View in Source in their right-click menu instead.

When it goes wrong

SymptomCheckFix
The class (ScoreCounter in the sample) does not appear in the class picker.Open Project Settings > Round Trip and look under Include Paths.Select the scripts folder (Platformer/Runtime in the sample) and use Add folder to Round Trip again.
The canvas shows a different method.Look at the highlighted row in the left rail and the method title in the toolbar.Click the method again (OnCoinCountChanged under ScoreCounter in the sample).
A value seems to appear from nowhere.Follow its colored wire back to a pill or a node's output.Pan left until the node that makes it is visible, then read the pin's label.
The canvas looks out of date after someone saved the script.Look for a Unity compile or import still in progress.Wait for Unity to settle, then use Reload to read the method again.
Full-size image