本地合并备份

This commit is contained in:
lishuo committed 2021-04-27 15:15:51 +08:00
1 parent 2b275d6dc5
commit 4353a38c96
44 files changed
+5568 -4294

No files matched your search

@@ -0,0 +1,36 @@
using DG.Tweening;
using System;
using System.Linq;
using UnityEngine;
using UnityEngine.UI;
namespace Assets.Scenes.Ride.Scripts
{
public class NumberDotween:MonoBehaviour
{
private Sequence mScoreSequence;
private Text text;
private float mOldScore = 0;
private void Start()
{
//函数内初始化
mScoreSequence = DOTween.Sequence();
//函数内设置属性
mScoreSequence.SetAutoKill(false);
text = transform.GetComponent<Text>();
}
public void AnimateNum(float newScore, int digit, string format)
{
mScoreSequence.Append(DOTween.To(delegate (float value)
{
var temp = Math.Round(value, digit);
//向Text组件赋值
text.text = string.Format(format, temp);
}, mOldScore, newScore, 0.4f));
//将更新后的值记录下来, 用于下一次滚动动画
mOldScore = newScore;
}
}
}