【发布时间】:2019-06-14 08:20:40
【问题描述】:
我正在使用新的 HDRP/LitTesselation 着色器。
我想在运行时更改Base Color + Opacity:
我将此代码添加到游戏对象的脚本中:
void start()
{
Color color = new Color(100, 50, 100, 150);
//Fetch the Renderer from the GameObject
Renderer rend = GetComponent<Renderer>();
//Set the main Color of the Material to green
rend.material.shader = Shader.Find("_Color");
rend.material.SetColor("_Color", color);
}
但它会在着色器中生成Hidden/InternalShaderError 错误。谁能指出我正确的方向?
【问题讨论】: