TintColor渐变

using System.Collections;
using DG.Tweening;
public class ColorChange : MonoBehaviour {

    private Material mat;
    public float sp = 0.5f;
    void Start()
    {
        mat = GetComponent().material;
    }
    void Update()
    {
        //sp += Time.deltaTime;

        Color col = mat.GetColor("_TintColor");
        col.a = Mathf.Lerp(col.a,0, Time.deltaTime*sp);
        mat.SetColor("_TintColor",col);
    }
}

你可能感兴趣的:(TintColor渐变)