public void PaintHeight(float xCenterNormalized, float yCenterNormalized)
{
int num;
int num2;
if ((this.size % 2) == 0)
{
num = Mathf.CeilToInt(xCenterNormalized * (this.terrainData.heightmapWidth - 1));
num2 = Mathf.CeilToInt(yCenterNormalized * (this.terrainData.heightmapHeight - 1));
}
else
{
num = Mathf.RoundToInt(xCenterNormalized * (this.terrainData.heightmapWidth - 1));
num2 = Mathf.RoundToInt(yCenterNormalized * (this.terrainData.heightmapHeight - 1));
}
int num3 = this.size / 2;
int num4 = this.size % 2;
int xBase = Mathf.Clamp(num - num3, 0, this.terrainData.heightmapWidth - 1);
int yBase = Mathf.Clamp(num2 - num3, 0, this.terrainData.heightmapHeight - 1);
int num7 = Mathf.Clamp((num + num3) + num4, 0, this.terrainData.heightmapWidth);
int num8 = Mathf.Clamp((num2 + num3) + num4, 0, this.terrainData.heightmapHeight);
int width = num7 - xBase;
int height = num8 - yBase;
float[,] heights = this.terrainData.GetHeights(xBase, yBase, width, height);
for (int i = 0; i < height; i++)
{
for (int j = 0; j < width; j++)
{
int ix = (xBase + j) - (num - num3);
int iy = (yBase + i) - (num2 - num3);
float strengthInt = this.brush.GetStrengthInt(ix, iy);
float num16 = heights[i, j];
num16 = this.ApplyBrush(num16, strengthInt * this.strength, j + xBase, i + yBase);
heights[i, j] = num16;
}
}
this.terrainData.SetHeightsDelayLOD(xBase, yBase, heights);
}