ドキュメント

Unity Engine

Unity Engine

ContainsVariant

Check if the specified ShaderVariantCollection.ShaderVariant exists in the collection.
読み終わるまでの所要時間 2 分最終更新 1ヶ月前

Definition

ContainsVariant(Shader, PassIdentifier, LocalKeyword[])

Check if the specified ShaderVariantCollection.ShaderVariant exists in the collection.
public bool ContainsVariant(Shader shader, PassIdentifier passId, LocalKeyword[] keywords)

Parameters

shader

Shader used in the variant.

PassIdentifier used in the variant.

LocalKeyword array of keywords used in the variant.

Returns

Type

Description

boolTrue if variant exists in collection, false otherwise.

Remarks

If only the
material
is provided, then this function will check for a shader variant using the set of Material.enabledKeywords combined with the global shader keywords that are currently enabled in the active context, unless explicitly provided via
globalKeywords
.

ContainsVariant(Material, PassIdentifier)

Check if the specified ShaderVariantCollection.ShaderVariant exists in the collection.
public bool ContainsVariant(Material mat, PassIdentifier passId)

Parameters


PassIdentifier used in the variant.

Returns

Type

Description

boolTrue if variant exists in collection, false otherwise.

Remarks

If only the
material
is provided, then this function will check for a shader variant using the set of Material.enabledKeywords combined with the global shader keywords that are currently enabled in the active context, unless explicitly provided via
globalKeywords
.

ContainsVariant(Material, PassIdentifier, GlobalKeyword[])

Check if the specified ShaderVariantCollection.ShaderVariant exists in the collection.
public bool ContainsVariant(Material mat, PassIdentifier passId, GlobalKeyword[] globalKeywords)

Parameters


PassIdentifier used in the variant.

globalKeywords

GlobalKeyword array of global keywords used in the variant.

Returns

Type

Description

boolTrue if variant exists in collection, false otherwise.

Remarks

If only the
material
is provided, then this function will check for a shader variant using the set of Material.enabledKeywords combined with the global shader keywords that are currently enabled in the active context, unless explicitly provided via
globalKeywords
.