Material材质 翻译:titan-志广
- color
- CopyPropertiesFromMaterial
- GetColor
- GetFloat
- GetMatrix
- GetTag
- GetTextureOffset
- GetTextureScale
- GetTexture
- GetVector
- HasProperty
- Lerp
- mainTextureOffset
- mainTextureScale
- mainTexture
- Material
- passCount
- renderQueue
- SetColor
- SetFloat
- SetMatrix
- SetPass
- SetTextureOffset
- SetTextureScale
- SetTexture
- SetVector
- shader
Material 材质
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 属性:
参考:Materials
using UnityEngine;
using System.Collections;
public class example : MonoBehaviour {
public void Awake() {
renderer.material.color = Color.red;
}
}
renderer.material.color = Color.red;
Variables变量
-
The shader used by the material.
材质使用的着色器。 -
The main material's color.
主材质的颜色。 -
The main material's texture.
主材质的纹理。 -
The texture offset of the main texture.
主纹理中的纹理偏移量。 -
The texture scale of the main texture.
主纹理中的纹理缩放量。 -
How many passes are in this material (Read Only).
在这个材质中有多少pass。(只读) -
Render queue of this material
这个材质的渲染队列
Constructors构造器
-
Create a temporary material from a shader source string.
从一个源Shader字符串创建一个材质
Functions函数
-
Set a named color value.
设置已命名的颜色值。 -
Get a named color value.
获取已命名的颜色值 -
Set a named vector value.
设置已命名的向量值 -
Get a named vector value.
获取已命名的向量值 -
Set a named texture.
设置已命名的纹理 -
Get a named texture.
设置已命名的纹理 -
Sets the placement offset of texture propertyName.
设置纹理propertyName的偏移量。 -
Gets the placement offset of texture propertyName.
获取纹理propertyName的偏移量。 -
Sets the placement scale of texture propertyName.
设置纹理propertyName的缩放量。 -
Gets the placement scale of texture propertyName.
获取纹理propertyName的缩放量 -
Set a named matrix for the shader.
为这个shader设置一个命名矩阵 -
Get a named matrix value from the shader.
从这个shader中获取命名矩阵的值 -
Set a named float value.
设置一个命名的浮点数 -
Get a named float value.
获取一个命名的浮点数 -
Checks if material's shader has a property of a given name.
检查材质的着色器是否具有给定名称的属性 -
Get the value of material's shader tag.
获取材质着色器的标签值。 -
Interpolate properties between two materials.
在两个材质之间插值 -
Activate the given pass for rendering.
为渲染激活给定的pass -
Copy properties from other material into this material.
拷贝其他材质的属性到这个材质
Inherited members继承成员
Inherited Variables继承变量
-
The name of the object. //物体的名字
-
Should the object be hidden, saved with the scene or modifiable by the user?
物体是否被隐藏、保存在场景中或被用户修改?
Inherited Functions继承函数
-
Returns the instance id of the object.
返回物体的实例ID -
Returns the name of the game object.
返回游戏物体的名称。
Inherited Class Functions继承类函数
-
Does the object exist?
物体是否存在? -
Clones the object original and returns the clone.
克隆原始物体,并返回克隆的物体 -
-
Removes a gameobject, component or asset.
删除一个游戏物体、组件或资源 -
Destroys the object obj immediately. It is strongly recommended to use Destroy instead.
立即销毁物体obj,强烈建议使用Destroy代替。 -
Returns a list of all active loaded objects of Type type.
返回Type类型的所有激活的加载的物体列表 -
Returns the first active loaded object of Type type.
返回Type类型第一个激活的加载的物体。 -
Compares if two objects refer to the same
比较如果两个物体相同 -
Compares if two objects refer to a different object
比较如果两个物体不同 -
Makes the object target not be destroyed automatically when loading a new scene.
加载新场景的时候使目标物体不被自动销毁。
最后修改:2011年9月12日 Monday 10:38