1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
 
public class textureOffset : MonoBehaviour
{
    public float verticalSpeed;
    public float horizontalSpeed;
 
    Renderer rend;
 
    void Start()
    {
        rend = GetComponent<Renderer>();
    }
 
    void Update()
    {
 
        float vOffset = Time.time * verticalSpeed;
        float hOffset = Time.time * horizontalSpeed;
 
        rend.material.mainTextureOffset = new Vector2(vOffset, hOffset);
    }
}
 
 
cs


Posted by 도이(doi)
,