| 1234567891011121314151617181920212223 |
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- public class skewing : MonoBehaviour
- {
- MeshRenderer mr;
- public Material material;
- public Material material1;
- float offset;
- public float scrollSpeed = 0.5F;
- private void Start()
- {
- //mr = GetComponent<MeshRenderer>();
- }
- void Update()
- {
- offset = -Time.time * scrollSpeed;
- //mr.materials[0].mainTextureOffset = new Vector2(-offset, 0);
- material.mainTextureOffset = new Vector2(-offset, 0);
- material1.mainTextureOffset = new Vector2(-offset, 0);
- }
- }
|