기술 자료

Unity Engine

Unity Engine

ContainsVariant

Check if the specified ShaderVariantCollection.ShaderVariant exists in the collection.
읽는 시간 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.

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.