Skip to main content

Class SwitchNode

A switch node is a flow control node that reads in a string input, and based on the value of that input, sends the execution flow out of the matching (or optional default) output pin.

public class SwitchNode : BaseNode, ITraversableNode

Inheritance​

Implements​

ITraversableNode

Fields​

Default​

Fallback output branch used when no match is found in OutputPins.

public Flow Default

Field Value​

Flow

In​

Input connection from the previous node in the flow graph.

public Flow In

Field Value​

Flow

OutputPins​

Dynamic output branches that are selected based on the Selection value. Each branch corresponds to a name in this array.

[FormerlySerializedAs("BranchOptions")]
public string[] OutputPins

Field Value​

string[]

Selection​

A string value used to determine which branch to activate. Matches against the names in OutputPins.

public string Selection

Field Value​

string

Methods​

GetValue(NodePort)​

Returns a value based on the requested port output.

public override object GetValue(NodePort port)

Parameters​

NameTypeDescription
portNodePort

Returns​

object

Remarks​

This is a placeholder method used to suppress warnings. It always returns null.

NextNode()​

Determines the next connected node based on the evaluated Selection. If the selection matches a branch in OutputPins, that branch is followed. Otherwise, the Default branch is used.

public Node NextNode()

Returns​

Node — The next Node in the sequence, or null if no branch is connected.

  • Fields
    • Default
    • In
    • OutputPins
    • Selection
  • Methods
    • GetValue(NodePort)
    • NextNode()