rokojori_action_library/Runtime/Conditions/IsValueBelowThreshold.cs

28 lines
441 B
C#

using Godot;
using Rokojori.Extensions;
namespace Rokojori;
[Tool]
[GlobalClass]
public partial class IsValueBelowThreshold:SceneCondition
{
[Export]
public NumberValue numberValue;
[Export]
public double threshold = -1;
public override bool Evaluate()
{
if ( numberValue == null )
{
return false;
}
var t = threshold < 0 ? numberValue.lowTreshold : threshold;
return numberValue.value < t;
}
}