public Bounds GetBounds(float minTime, float maxTime, int component)
{
this.CalculateCurves(minTime, maxTime);
float positiveInfinity = float.PositiveInfinity;
float negativeInfinity = float.NegativeInfinity;
foreach (KeyValuePair<float, Vector3> pair in this.points)
{
if (pair.Value[component] > negativeInfinity)
{
negativeInfinity = pair.Value[component];
}
if (pair.Value[component] < positiveInfinity)
{
positiveInfinity = pair.Value[component];
}
}
if (positiveInfinity == float.PositiveInfinity)
{
positiveInfinity = 0f;
negativeInfinity = 0f;
}
return new Bounds(new Vector3((maxTime + minTime) * 0.5f, (negativeInfinity + positiveInfinity) * 0.5f, 0f), new Vector3(maxTime - minTime, negativeInfinity - positiveInfinity, 0f));
}