创建带小数的流水动画
我正在尝试创建一个动画,该动画将十进制数从 startNumber 到 endNumber 进行动画处理。我所拥有的是:
string resultPoints = ""; // The result of the animation
float startPoints = 0f; // From what point should we start
float endPoints = 79.57f; // End points
float rNo = startPoints;
float wTime = 0.01f;
wTime = 1f / (endPoints - startPoints);
endPoints++;
while (rNo < endPoints)
{
resultPoints = "" + rNo;
rNo++;
yield return new WaitForSeconds(wTime);
}
这会执行动画,但仅限于整数(整数)。如何用小数创建这个函数?
如有任何帮助,我们将不胜感激:-)
I am trying to crate an animation which animates a decimal number from startNumber to endNumber. What I have is this:
string resultPoints = ""; // The result of the animation
float startPoints = 0f; // From what point should we start
float endPoints = 79.57f; // End points
float rNo = startPoints;
float wTime = 0.01f;
wTime = 1f / (endPoints - startPoints);
endPoints++;
while (rNo < endPoints)
{
resultPoints = "" + rNo;
rNo++;
yield return new WaitForSeconds(wTime);
}
This do the animation, but only with whole numbers (integer). How do I create this function with decimals?
Any help is appreciated :-)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论