本文整理匯總了C#中UnityEngine.Material.SetColorArray方法的典型用法代碼示例。如果您正苦於以下問題:C# Material.SetColorArray方法的具體用法?C# Material.SetColorArray怎麽用?C# Material.SetColorArray使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類UnityEngine.Material
的用法示例。
在下文中一共展示了Material.SetColorArray方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: ApplyToMaterial
public void ApplyToMaterial(Material material)
{
material.SetInt("layerCount", layers.Length);
// lambda's!
material.SetColorArray("baseColors", layers.Select(x => x.tint).ToArray());
material.SetFloatArray("baseStartHeights", layers.Select(x => x.startHeight).ToArray());
material.SetFloatArray("baseBlends", layers.Select(x => x.blendStrength).ToArray());
material.SetFloatArray("baseColorStrengths", layers.Select(x => x.tintStrength).ToArray());
material.SetFloatArray("baseTextureScales", layers.Select(x => x.textureScale).ToArray());
Texture2DArray texturesArray = GenerateTextureArray(layers.Select(x => x.texture).ToArray());
material.SetTexture("baseTextures", texturesArray);
UpdateMeshHeights(material, savedMinHeight, savedMaxHeight);
}