Flow
Read and build the decisions, repetition, exception paths, and exits that shape a C# method.
On this page
Flow nodes answer one question: where can execution go next? They turn braces and keywords into named paths you can follow from the entry node to a return, throw, or normal end.
These are three different methods in the Platformer sample, chosen to show how the white exec paths change with the job.
The flow guides
Section titled “The flow guides”- Branch: choose true or false, including chained
else ifpaths. - Loops: repeat with
for,foreach,while, ordo-while, and understand break and continue. - Switch: send one value to cases or expression arms, including defaults and
goto case. - Try, catch, and using: show exception handlers, filters, cleanup, and resource scopes.
- Return and throw: finish a method normally, leave early, or terminate with an exception.
Reading flow
Section titled “Reading flow”Follow one exec output at a time. On a branch, choose true or false. On a loop, follow loop body once, then jump to completed. On a switch, pick one arm. This gives you a readable story before you inspect every alternative.
The flow guides draw their examples from FlowExamples, a class in the Platformer sample with one small method per flow shape, each kept to the fewest statements that show it. Open the class in the Graph view and the canvases match the figures. The same nodes appear in the sample’s gameplay code, which each guide points to for a fuller example. Those methods are ordinary C# shown as diagrams, just like the methods in your own project. The C# remains the source of truth, and Compile writes visual drafts back into those same method bodies.
- Branch: start with the most common decision.
- Loops: trace repeated work without getting trapped in the cycle.
- Return and throw: learn where paths stop.


