EVERYTHING
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
using System;
|
||||
using UnityEngine;
|
||||
|
||||
[DisallowMultipleComponent]
|
||||
public sealed class CooldownBehavior : NodeBehavior
|
||||
{
|
||||
private float nextAllowedAt;
|
||||
|
||||
public override void OnRun(string inputPortName)
|
||||
{
|
||||
if (base.IsAuthoritative && string.Equals(inputPortName, "In", StringComparison.Ordinal))
|
||||
{
|
||||
float num = Mathf.Max(0f, (float)GetInputNumber("Seconds"));
|
||||
if (!(Time.unscaledTime < nextAllowedAt))
|
||||
{
|
||||
nextAllowedAt = Time.unscaledTime + num;
|
||||
TriggerOutput("Out");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user