首页 > 学院 > 开发设计 > 正文

进度条

2019-11-06 06:36:06
字体:
来源:转载
供稿:网友
  public  float speed = 0f;    public  Transform PRocessTrans;//进度    public  Transform indicatorTrans;//text    public float currentAmout;//进度%    public float targetProcess;//总进度    void Update()    {        if (currentAmout < targetProcess)        {            currentAmout += speed;            if (currentAmout > targetProcess)                currentAmout = targetProcess;            indicatorTrans.GetComponent<Text>().text = ((int)currentAmout).ToString() + "%";            processTrans.GetComponent<Image>().fillAmount = currentAmout / 100.0f;        }    }
发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表