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.CopyPropertiesFromMaterial 从材质拷贝属性
function CopyPropertiesFromMaterial (mat : Material) : void
Description描述
Copy properties from other material into this material.
拷贝其他材质的属性到这个材质
using UnityEngine;
using System.Collections;
public class example : MonoBehaviour {
public Material mat;
public void Awake() {
if (!typeof(mat)) {
Debug.LogError("Assign a material on the inspector.");
return;
}
renderer.material.CopyPropertiesFromMaterial(mat);
}
}
// Attach this to a gameObject that has a renderer.
//把它附加在有renderer组件的游戏物体(gameobject)上
// Copies any property mat has and assigns it to this transform material
// 拷贝所有属性并将它分配给此转换材质
var mat : Material;
if (!mat) {
Debug.LogError ("Assign a material on the inspector.");
return;
}
renderer.material.CopyPropertiesFromMaterial(mat);
最后修改:2011年1月22日 Saturday 21:56