IndieGame/client/Assets/ParadoxNotion/NodeCanvas/Tasks/Actions/Blackboard/SampleCurve.cs

27 lines
569 B
C#
Raw Normal View History

2024-10-11 10:12:15 +08:00
using NodeCanvas.Framework;
using ParadoxNotion.Design;
using UnityEngine;
namespace NodeCanvas.Tasks.Actions
{
[Category("✫ Blackboard")]
public class SampleCurve : ActionTask
{
[RequiredField]
public BBParameter<AnimationCurve> curve;
[SliderField(0, 1)]
public BBParameter<float> sampleAt;
[BlackboardOnly]
public BBParameter<float> saveAs;
protected override void OnExecute() {
saveAs.value = curve.value.Evaluate(sampleAt.value);
EndAction();
}
}
}