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.mainTextureOffset 主纹理偏移量
var mainTextureOffset : Vector2
Description描述
The texture offset of the main texture.
主纹理中的纹理偏移量
The same as using GetTextureOffset or SetTextureOffset with "_MainTex" name.
这个与带有"_MainTex"名称的 GetTextureOffset 和 SetTextureOffset 相同
参考:SetTextureOffset, GetTextureOffset.
using UnityEngine;
using System.Collections;
public class example : MonoBehaviour {
public float scrollSpeed = 0.5F;
void Update() {
float offset = Time.time * scrollSpeed;
renderer.material.mainTextureOffset = new Vector2(offset, 0);
}
}
最后修改:2011年1月21日 Friday 22:22