28 lines
441 B
C#
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;
|
||
|
|
}
|
||
|
|
}
|