public void GenerateTerrainTexture() { if (colorMap != null && colorMap.Length > 0) { texture = new Texture2D(textureSize, textureSize) { filterMode = FilterMode.Point, wrapMode = TextureWrapMode.Clamp }; texture.SetPixels(colorMap); texture.Apply(); } if (bottomLeft != null) { bottomLeft.GenerateTerrainTexture(); } if (bottomRight != null) { bottomRight.GenerateTerrainTexture(); } if (topLeft != null) { topLeft.GenerateTerrainTexture(); } if (topRight != null) { topRight.GenerateTerrainTexture(); } }
private void DrawTerrain() { root.GenerateTerrainTexture(); }