TextureData.ApplyToMaterial C# (CSharp) Method

ApplyToMaterial() public method

public ApplyToMaterial ( Material material ) : void
material Material
return void
	public void ApplyToMaterial(Material material) {
		//
	}
}

Usage Example

示例#1
0
    public void DrawMapInEditor()
    {
        textureData.ApplyToMaterial(terrainMaterial);
        textureData.UpdateMeshHeights(terrainMaterial, heightMapSettings.minHeight, heightMapSettings.maxHeight);

        ChunkBorderInfo chunkBorderInfo = new ChunkBorderInfo(false, FalloffGenerator.Corner.TOPLEFT, false, FalloffGenerator.Edge.TOP);
        HeightMap       heightMap       = HeightMapGenerator.GenerateHeightMap(meshSettings.numberVerticesPerLine, meshSettings.numberVerticesPerLine, heightMapSettings, mapRulesSettings, Vector2.zero, chunkBorderInfo);

        CleanScene();

        if (drawMode == DrawMode.NoiseMap)
        {
            DrawTexture(TextureGenerator.TextureFromHeightMap(heightMap));
        }
        else if (drawMode == DrawMode.FalloffMap)
        {
            DrawTexture(TextureGenerator.TextureFromHeightMap(new HeightMap(FalloffGenerator.GenerateFalloffMap(meshSettings.numberVerticesPerLine, mapRulesSettings), 0, 1)));
        }
        else if (drawMode == DrawMode.Mesh)
        {
            DrawMesh(MeshGenerator.GenerateTerrainMesh(heightMap.values, meshSettings, editorPreviewLOD));
        }
        else if (drawMode == DrawMode.Map)
        {
            DrawMesh(MeshGenerator.GenerateTerrainMesh(heightMap.values, meshSettings, editorPreviewLOD));
            DrawMap();
        }
    }
All Usage Examples Of TextureData::ApplyToMaterial
TextureData