22 lines
395 B
C#
22 lines
395 B
C#
using System;
|
|
using UnityEngine;
|
|
|
|
[DisallowMultipleComponent]
|
|
public sealed class IfBehavior : NodeBehavior
|
|
{
|
|
public override void OnRun(string inputPortName)
|
|
{
|
|
if (base.IsAuthoritative && string.Equals(inputPortName, "If", StringComparison.Ordinal))
|
|
{
|
|
if (GetInputValue("Condition").AsBool())
|
|
{
|
|
TriggerOutput("True");
|
|
}
|
|
else
|
|
{
|
|
TriggerOutput("False");
|
|
}
|
|
}
|
|
}
|
|
}
|