美文网首页
TintColor渐变

TintColor渐变

作者: Moment__格调 | 来源:发表于2016-12-15 10:39 被阅读21次
using System.Collections;
using DG.Tweening;
public class ColorChange : MonoBehaviour {

    private Material mat;
    public float sp = 0.5f;
    void Start()
    {
        mat = GetComponent<MeshRenderer>().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渐变

      本文链接:https://www.haomeiwen.com/subject/oigwmttx.html