public Matrix4x4 GetMatrix (string name);
public Matrix4x4 GetMatrix (int nameID);

参数

nameID通过 Shader.PropertyToID 检索的属性的名称 ID。
name属性的名称。

描述

从着色器获取指定的矩阵值。

这主要用于需要额外矩阵参数的自定义 着色器。矩阵参数不会在材质 Inspector 中公开, 但是可以在脚本中使用 SetMatrixGetMatrix 进行设置和查询。

另请参阅:SetMatrixMaterialsShaderLab documentationShader.PropertyToID