标签:text play ogr 指定 实现 closed 执行 图片 数据
private Image progressBar; private float currentProgress = 0; /// <summary> /// 进度条需要持续的时长 /// </summary> private float duration = 5f;//这个时间可以任意定义 private void ProgressBar() { currentProgress += Time.deltaTime; progressBar.fillAmount = currentProgress / duration; if (currentProgress >= duration) { progressBar.fillAmount = 1; } }
private Text showText;//展示的Text private float time = 5f;//指定的时间 private float currentVaule = 0f;//起始值 private float targetVaule = 115f;//目标值 /// <summary> /// 数据递增 /// </summary> public void DataIncrement() { currentVaule += Time.deltaTime * (targetVaule / time); if (currentVaule <= targetVaule) { showText.text = currentVaule.ToString("0000.00"); } else { currentVaule = targetVaule; showText.text = currentVaule.ToString("0000.00"); }
注:以上方法需放在Update中调用执行
标签:text play ogr 指定 实现 closed 执行 图片 数据
原文地址:https://www.cnblogs.com/Study088/p/14925648.html