You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

30 lines
973 B

using UnityEngine;
namespace UnityEditor.VFX.Operator
{
[VFXHelpURL("Operator-SampleCurve")]
[VFXInfo(category = "Sampling")]
class SampleCurve : VFXOperator
{
override public string name { get { return "Sample Curve"; } }
public class InputProperties
{
[Tooltip("Sets the curve to sample from.")]
public AnimationCurve curve = VFXResources.defaultResources.animationCurve;
[Tooltip("Sets the time along the curve to take a sample from.")]
public float time = 0.0f;
}
public class OutputProperties
{
[Tooltip("Outputs the sampled value from the curve at the specified time.")]
public float s = 0;
}
protected override sealed VFXExpression[] BuildExpression(VFXExpression[] inputExpression)
{
return new[] { new VFXExpressionSampleCurve(inputExpression[0], inputExpression[1]) };
}
}
}