123456789101112131415161718192021222324252627282930313233 |
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- using UnityEngine.UI;
- public class NZYDissEffect : MonoBehaviour
- {
- public float tilingX = 0;
- public float tilingY = 0;
- public float offsetX = 0;
- public float offsetY = 0;
- public float diss = 0;
- private Material mat;
- private float addSize = 0;
- // Start is called before the first frame update
- void Start()
- {
- RawImage raw = this.GetComponent<RawImage>();
- mat = raw.material;
- }
- // Update is called once per frame
- void Update()
- {
- addSize = Time.deltaTime * tilingX;
- //float nowTwist = mat.GetFloat("_Twist");
- //mat.SetFloat("_Twist", nowTwist + addSize);
- Texture t = mat.GetTexture("_MainTex");
- mat.SetTextureScale("_MainTex", new Vector2(tilingX, tilingY));
- mat.SetTextureOffset("_MainTex", new Vector2(offsetX, offsetY));
- mat.SetFloat("_Diss", diss);
- }
- }
|