IndieGame/client/Assets/ParadoxNotion/NodeCanvas/Tasks/Conditions/Blackboard/CheckFloat.cs
DOBEST\zhaoyingjie f242607587 初始化工程
2024-10-11 10:12:15 +08:00

29 lines
782 B
C#

using NodeCanvas.Framework;
using ParadoxNotion;
using ParadoxNotion.Design;
namespace NodeCanvas.Tasks.Conditions
{
[Category("✫ Blackboard")]
public class CheckFloat : ConditionTask
{
[BlackboardOnly]
public BBParameter<float> valueA;
public CompareMethod checkType = CompareMethod.EqualTo;
public BBParameter<float> valueB;
[SliderField(0, 0.1f)]
public float differenceThreshold = 0.05f;
protected override string info {
get { return valueA + OperationTools.GetCompareString(checkType) + valueB; }
}
protected override bool OnCheck() {
return OperationTools.Compare((float)valueA.value, (float)valueB.value, checkType, differenceThreshold);
}
}
}