文档

Unity Engine

Unity Engine

GetShaderPassEnabled(string)

Checks whether a given Shader pass is enabled on this Material.
阅读时间1 分钟最后更新于 1 个月前

Definition

  • Type: Method
  • Namespace: UnityEngine
  • Assembly: UnityEngine.CoreModule
public bool GetShaderPassEnabled(string passName)

Parameters

passName

Shader pass name (case insensitive).

Returns

Type

Description

boolTrue if the Shader pass is enabled.

Remarks

By default, all shader passes are enabled. Note that this method only returns
false
if the pass has been explicitly disabled for this Material using Material.SetShaderPassEnabled. If a pass does not exist in the currently used Shader, but has not been disabled, then the method still returns
true
.
Additional Resources: Material.SetShaderPassEnabled, RenderLoop, Shader pass tags.