16 lines
385 B
C#
16 lines
385 B
C#
using System;
|
|
using UnityEngine;
|
|
|
|
[DisallowMultipleComponent]
|
|
public sealed class RandomBehavior : NodeBehavior
|
|
{
|
|
public override void OnRun(string inputPortName)
|
|
{
|
|
if (base.IsAuthoritative && string.Equals(inputPortName, "Roll", StringComparison.Ordinal))
|
|
{
|
|
SetOutputValueIfChanged("Value", BSValue.FromNumber(UnityEngine.Random.value));
|
|
TriggerOutput("Rolled");
|
|
}
|
|
}
|
|
}
|