DoTween DOColor颜色、DOFade透明度 渐变动画

using UnityEngine;
using System.Collections;
using DG.Tweening;
using UnityEngine.UI;

public class TextColorTween : MonoBehaviour {

    private Text text;	
	void Start () {
	    text = GetComponent<Text>();
        //颜色渐变,参数:1、红色,2、时间
        text.DOColor(Color.red, 2);
        //渐显,控制透明度的,参数1、alpha值,2、时间
	    text.DOFade(1, 3);
	}
    
}

猜你喜欢

转载自blog.csdn.net/cuijiahao/article/details/104306949