Class If
Branches flow by checking if a condition is true or false.
Inherited Members
Namespace: Unity.VisualScripting
Syntax
[UnitCategory("Control")]
[UnitOrder(0)]
[RenamedFrom("Bolt.Branch")]
[RenamedFrom("Unity.VisualScripting.Branch")]
public sealed class If : Unit, IBranchUnit, IUnit, IGraphElementWithDebugData, IGraphElement, IGraphItem, INotifiedCollectionItem, IDisposable, IPrewarmable, IAotStubbable, IIdentifiable, IAnalyticsIdentifiable
Properties
condition
The condition to check.
Declaration
[DoNotSerialize]
public ValueInput condition { get; }
Property Value
Type | Description |
---|---|
ValueInput |
enter
The entry point for the branch.
Declaration
[DoNotSerialize]
public ControlInput enter { get; }
Property Value
Type | Description |
---|---|
ControlInput |
Implements
ifFalse
The action to execute if the condition is false.
Declaration
[DoNotSerialize]
[PortLabel("False")]
public ControlOutput ifFalse { get; }
Property Value
Type | Description |
---|---|
ControlOutput |
ifTrue
The action to execute if the condition is true.
Declaration
[DoNotSerialize]
[PortLabel("True")]
public ControlOutput ifTrue { get; }
Property Value
Type | Description |
---|---|
ControlOutput |
Methods
Definition()
Declaration
protected override void Definition()
Overrides
Enter(Flow)
Declaration
public ControlOutput Enter(Flow flow)
Parameters
Type | Name | Description |
---|---|---|
Flow | flow |
Returns
Type | Description |
---|---|
ControlOutput |