Untitled
using UnityEngine; public class ImageTransitionController : MonoBehaviour { public Material transitionMaterial; public float transitionSpeed = 1f; private float blendValue = 0f; void Update() { // Update the blend value over time blendValue += Time.deltaTime * transitionSpeed; if (blendValue > 4f) blendValue = 0f; // Loop back to the start // Apply the blend value to the material transitionMaterial.SetFloat("_Blend", blendValue); } }
Leave a Comment