using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class ChangeDissolveOverTime : MonoBehaviour
{
    public float speed = 1f;
    public string dissolveKeyword = "_DissolveIntensity";
    Material mat;
    void Start()
    {
        mat = GetComponent<Renderer>().material;
    }

    void Update()
    {
        // set dissolve threshold to a random value
        float randomValue = Mathf.PerlinNoise(Time.time * speed, 0f);
        mat.SetFloat(dissolveKeyword,  randomValue);
    }
}
