当你更改 渲染模式 时,Unity 会对材质进行一系列更改。没有单个 C# API 可以更改材质的渲染模式,但你可以在代码中进行相同的更改。
要查看更改 渲染模式 时 Unity 所做的更改
switch (blendMode)
{
case BlendMode.Opaque:
// Changes associated with Opaque Rendering Mode are here
break;
case BlendMode.Cutout:
// Changes associated with Cutout Rendering Mode are here
break;
case BlendMode.Fade:
// Changes associated with Fade Rendering Mode are here
break;
case BlendMode.Transparent:
// Changes associated with Transparent Rendering Mode are here
break;
}