EVERYTHING
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
using System;
|
||||
using UnityEngine;
|
||||
|
||||
[DisallowMultipleComponent]
|
||||
public sealed class SRLatchBehavior : NodeBehavior
|
||||
{
|
||||
private bool state;
|
||||
|
||||
private void Start()
|
||||
{
|
||||
if (base.IsAuthoritative)
|
||||
{
|
||||
SetOutputValueIfChanged("Q", BSValue.FromBool(state));
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnRun(string inputPortName)
|
||||
{
|
||||
if (base.IsAuthoritative)
|
||||
{
|
||||
if (string.Equals(inputPortName, "Set", StringComparison.Ordinal))
|
||||
{
|
||||
state = true;
|
||||
SetOutputValueIfChanged("Q", BSValue.FromBool(state));
|
||||
}
|
||||
else if (string.Equals(inputPortName, "Reset", StringComparison.Ordinal))
|
||||
{
|
||||
state = false;
|
||||
SetOutputValueIfChanged("Q", BSValue.FromBool(state));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user