コード例 #1
0
ファイル: Quadrant.cs プロジェクト: Dyzalonius/MapCommander
    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();
        }
    }
コード例 #2
0
 private void DrawTerrain()
 {
     root.GenerateTerrainTexture();
 }