class in UnityEngine / Inherits from: Object
The material class.
材质类。
This class exposes all properties from a material, allowing you to animate them. You can also use it to set custom shader properties that can't be accessed through the inspector (e.g. matrices).
此类暴露了一个材质的所有属性,允许您对它们进行动画处理。你也可以使用它来设置自定义的Shader属性,但是无法通过检视面板访问属性(例如矩阵)。
In order to get the material used by an object, use the Renderer.material property.
为了获得一个对象使用的材质,可以使用 Renderer.material 属性。
color | The main material's color. 使用GetColor或SetColor设置_Color是一样的。 |
globalIlluminationFlags | Defines how the material should interact with lightmaps and lightprobes. 定义材质应与光照贴图和灯光探测器怎样相互作用。 |
mainTexture | The material's texture. 与使用GetTexture 或SetTexture设置_MainTex是一样的。 |
mainTextureOffset | The texture offset of the main texture. 主纹理的纹理偏移值。 |
mainTextureScale | The texture scale of the main texture. 主纹理的纹理缩放值。 |
passCount | How many passes are in this material (Read Only). 在这个材质中有多少pass。(只读) |
renderQueue | Render queue of this material. 该材质的渲染队列。 |
shader | The shader used by the material. 用于材质的着色器。 |
shaderKeywords | Additional shader keywords set by this material. 由该材质设置的其他着色器关键词。 |
CopyPropertiesFromMaterial | Copy properties from other material into this material. 从其他材质复制属性到该材质。 |
DisableKeyword | Unset a shader keyword. 不设置一个着色器关键词。 |
EnableKeyword | Set a shader keyword that is enabled by this material. 设置一个由该材质启用的着色器关键词。 |
GetColor | Get a named color value. 获取已命名的颜色值 。 |
GetFloat | Get a named float value. 获取一个命名的浮点数 |
GetInt | Get a named integer value. 获取已命名的整数值。 |
GetMatrix | Get a named matrix value from the shader. 从这个shader中获取命名矩阵的值。 |
GetTag | Get the value of material's shader tag. 获取材质着色器的标签值。 |
GetTexture | Get a named texture. 获取已命名的纹理。 |
GetTextureOffset | Gets the placement offset of texture propertyName. 获取纹理propertyName的偏移值。 |
GetTextureScale | Gets the placement scale of texture propertyName. 获取propertyName纹理的位置缩放值。 |
GetVector | Get a named vector value. 获取已命名的向量值。 |
HasProperty | Checks if material's shader has a property of a given name. 检查材质的shader是否有给定名称的属性。 |
IsKeywordEnabled | Is the shader keyword enabled on this material? 该材质的shader关键词是否启用? |
Lerp | Interpolate properties between two materials. 在两个材质之间插值 |
SetBuffer | Set a ComputeBuffer value. 设置ComputeBuffer的值。 |
SetColor | Set a named color value. 设置已命名的颜色值。 |
SetFloat | Set a named float value. 设置已命名的浮点数值。 |
SetInt | Set a named integer value. 设置已命名的整数值。 |
SetMatrix | Set a named matrix for the shader. 为这个shader设置一个命名矩阵。 |
SetOverrideTag | Sets an override tag/value on the material. 设置该材质的重写标签。 |
SetPass | Activate the given pass for rendering. 为渲染激活给定的pass。 |
SetTexture | Set a named texture. 设置已命名的纹理。 |
SetTextureOffset | Sets the placement offset of texture propertyName. 设置纹理propertyName的偏移量。 |
SetTextureScale | Sets the placement scale of texture propertyName. 设置纹理propertyName的缩放量。 |
SetVector | Set a named vector value. 设置已命名的向量值。 |