// NiuZhiYing using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.UI; public class XiaoRongEffect : MonoBehaviour { Material mat; public float range = 1.0f; // Use this for initialization void Start () { mat = this.GetComponent().material; } // Update is called once per frame void Update () { if (mat) { mat.SetFloat("_range", range); } } void OnEnable() { this.range = 1.0f; } }