Firstborn/Assets/AwesomeTechnologies/VegetationStudioPro/Runtime/Utility/Extentions/AnimationCurveExtention.cs

17 lines
453 B
C#
Raw Permalink Normal View History

using UnityEngine;
namespace AwesomeTechnologies.Utility
{
public static class AnimationCurveExtention
{
public static float[] GenerateCurveArray(this AnimationCurve self, int sampleCount)
{
float[] returnArray = new float[sampleCount];
for (int j = 0; j <= sampleCount-1; j++)
returnArray[j] = self.Evaluate(j / (float)sampleCount);
return returnArray;
}
}
}