private void ApplyTerrainSplat()
{
if ((this.m_Terrain != null) && (this.m_Terrain.terrainData != null))
{
SplatPrototype[] splatPrototypes = this.m_Terrain.terrainData.splatPrototypes;
if (this.m_Index == -1)
{
SplatPrototype[] destinationArray = new SplatPrototype[splatPrototypes.Length + 1];
Array.Copy(splatPrototypes, 0, destinationArray, 0, splatPrototypes.Length);
this.m_Index = splatPrototypes.Length;
splatPrototypes = destinationArray;
splatPrototypes[this.m_Index] = new SplatPrototype();
}
splatPrototypes[this.m_Index].texture = this.m_Texture;
splatPrototypes[this.m_Index].normalMap = this.m_NormalMap;
splatPrototypes[this.m_Index].tileSize = this.m_TileSize;
splatPrototypes[this.m_Index].tileOffset = this.m_TileOffset;
splatPrototypes[this.m_Index].specular = this.m_Specular;
splatPrototypes[this.m_Index].metallic = this.m_Metallic;
splatPrototypes[this.m_Index].smoothness = this.m_Smoothness;
this.m_Terrain.terrainData.splatPrototypes = splatPrototypes;
EditorUtility.SetDirty(this.m_Terrain);
}
}