27 lines
612 B
C#
Raw Normal View History

2025-09-06 17:17:39 +04:00
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class PortalEffect : MonoBehaviour
{
Material mat;
//
// Start is called before the first frame update
void Start()
{
//get the texture applied to the model
mat = GetComponent<MeshRenderer>().material;
}
// Update is called once per frame
void Update()
{
//increment the y offset of the material
//mat.mainTextureOffset += new Vector2(0, 0.5f * Time.deltaTime);
//make the maintexture sine wave
mat.mainTextureOffset = new Vector2(0, Mathf.Sin(Time.time * 2.0f) / 10.0f);
}
}