Unity DOTween.To

 _Afra 的博客_会思考的猴子_CSDN博客-unity,Arduino,Processing领域博主

         Image image;
        private void Awake()
        {
            image = GetComponent();
            image.material.SetFloat("_Alpha", 0);
            DOTween.To(() => image.material.GetFloat("_Alpha"), x =>         image.material.SetFloat("_Alpha",x), 1, 3);

 DisplayUGUI displayUGUI = UILogoVideo.GetComponent();
                DOTween.To(() => displayUGUI.color.a, x => displayUGUI.color = new Color(displayUGUI.color.r, displayUGUI.color.g, displayUGUI.color.b, x), 0, 1).SetEase(Ease.Linear).OnComplete(() =>
                {
                   
                });
        }

fillAmount 也有自己的api
  : DOFillAmount(float to, float duration)

 DOTween.To(() => image.fillAmount, x => zFPUIFirstPlayerAreaMaskImage.fillAmount = x, 1, 0.8f).SetEase(Ease.Linear).OnComplete(() =>
            {
                // Do SomeThing

            });

这两种写法是一样的 

  // 倒计时视频进场
  DOTween.To(() => AVProVideo.anchoredPosition.y, _ => AVProVideo.anchoredPosition = new             
            Vector2(AVProVideo.anchoredPosition.x, _), -450f, 0.5f).SetEase(Ease.Linear);
  // 倒计时视频进场
  AVProVideo.DOAnchorPosY(-450f, 0.5f);

这里写图片描述

你可能感兴趣的:(unity,unity)