private void SetupSelectionMeshColors()
{
ClothSkinningCoefficient[] coefficients = this.cloth.coefficients;
int length = coefficients.Length;
Color[] colors = new Color[length * this.m_MeshVerticesPerSelectionVertex];
float num2 = 0f;
float num3 = 0f;
for (int i = 0; i < coefficients.Length; i++)
{
float coefficient = this.GetCoefficient(coefficients[i]);
if (coefficient < float.MaxValue)
{
if (coefficient < num2)
{
num2 = coefficient;
}
if (coefficient > num3)
{
num3 = coefficient;
}
}
}
for (int j = 0; j < length; j++)
{
Color black;
float val = this.GetCoefficient(coefficients[j]);
if (val >= float.MaxValue)
{
black = Color.black;
}
else
{
if ((num3 - num2) != 0f)
{
val = (val - num2) / (num3 - num2);
}
else
{
val = 0f;
}
black = this.GetGradientColor(val);
}
for (int k = 0; k < this.m_MeshVerticesPerSelectionVertex; k++)
{
colors[(j * this.m_MeshVerticesPerSelectionVertex) + k] = black;
}
}
this.m_MaxVisualizedValue[(int) this.drawMode] = num3;
this.m_MinVisualizedValue[(int) this.drawMode] = num2;
this.AssignColorsToMeshArray(colors, this.m_SelectionMesh);
}