Version: 2022.1

ShaderUtil.UpdateShaderAsset

切换到手册
public static void UpdateShaderAsset (AssetImporters.AssetImportContext context, Shader shader, string source, bool compileInitialShaderVariants);
public static void UpdateShaderAsset (Shader shader, string source, bool compileInitialShaderVariants);
public static void UpdateShaderAsset (Shader shader, string source);

参数

context A context object that the asset system needs to register shader dependencies properly.
source 一个字符串,包含在 ShaderLab 代码中编写的着色器。
compileInitialShaderVariants 设置为 true 可编译包含在源字符串中的 ShaderLab 代码;否则为 false。
shader 要更新的 Shader

描述

Replaces the existing source code in the specified shader with the source code in the supplied string.

Copyright © 2023 Unity Technologies
优美缔软件(上海)有限公司 版权所有
"Unity"、Unity 徽标及其他 Unity 商标是 Unity Technologies 或其附属机构在美国及其他地区的商标或注册商标。其他名称或品牌是其各自所有者的商标。
公安部备案号:
31010902002961