Unity物体材质属性Offset动态偏移
cpp
MeshRenderer mr;
float offset;
public float scrollSpeed = 0.5F;
private void Start()
{
mr = GetComponent<MeshRenderer>();
}
void Update()
{
offset = -Time.time * scrollSpeed;
mr.material.mainTextureOffset = new Vector2(0, -offset);
}