using System.Collections; using System.Collections.Generic; using UnityEngine; public class BurnTest : MonoBehaviour { public GameObject burnObj; private float burnData; // Use this for initialization void Start () { burnData = 0.8f; } // Update is called once per frame void Update () { if (burnData > -0.8) { print(burnData); burnData -= Time.deltaTime/5; burnObj.GetComponent().material.SetFloat("_CutOutValue", burnData); } } }