血条平滑

public void StartIncreaseCoinCount(){
        if (startIncreaseCoin||UnityEngine.SceneManagement.SceneManager.GetActiveScene().name!=Utility.LevelSceneName) {
            return;
        }
        AudioManager.Instance.PlayTone(ToneType.ui_reward_add);
        startIncreaseCoin = true;

        long startValue = long.Parse(coinCount.text);

        long endValue = DataCenter.Instance.CurrentProfile.goldCount;

        DOTween.To(x => {
            coinCount.text = (long)x+"";
            if(x==endValue){
                coinCount.text = DataCenter.Instance.CurrentProfile.goldCount+"";
                startIncreaseCoin = false;
            }
        }, startValue, endValue, 2.0f);
    }

你可能感兴趣的:(血条平滑)