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.SetVector 设置向量
function SetVector (propertyName : string, vector : Vector4) : void
Description描述
Set a named vector value.
设置已命名颜色向量值
Four component vectors and colors are the same in Unity shaders. SetVector does exactly the same as SetColor just the input data type is different (xyzw in the vector becomes rgba in the color).
在unity着色器中四维向量和颜色的结果是相同的。SetVector和` SetColor的不同之处在于只是输入的数据类型不同 (xyzw 向量转换成 rgba 颜色)。
using UnityEngine;
using System.Collections;
public class example : MonoBehaviour {
public void Awake() {
renderer.material.SetVector("_Color", new Vector4(0, 0, 1, 1));
}
}
renderer.material.SetVector("_Color", Vector4 (0,0,1,1));
最后修改:2011年1月22日 Saturday 20:46