Version: 2020.2
public void EnableKeyword (string keyword);

描述

Sets a Shader keyword locally for this Compute Shader.

Unity internally compiles Shaders into multiple variants, and then picks the matching one based on locally set keywords (EnableKeyword and DisableKeyword), or globally set Shader keywords (Shader.EnableKeyword and Shader.DisableKeyword).

See Also: DisableKeyword, shaderKeywords, multiple shader program variants.