zoukankan      html  css  js  c++  java
  • unity:倒计时

    int Min = 6;//分钟
    int Stime = 0;//
    
    
    IEnumerator CountDown()
        {
    
            while (Stime > 0)
            {
                timer.GetComponent<Text>().text = "0"+Min.ToString() +":"+ Stime.ToString();
                yield return new WaitForSeconds(1);
                Stime--;
    
            }
            while (Stime == 0)
            {
                timer.GetComponent<Text>().text = "0" + Min.ToString() + ":" + Stime.ToString()+"0";
                yield return new WaitForSeconds(1);
                Stime--;
    
            }
            while (Stime < 0)//秒减到0以后重新调用协程,分钟数减去1
            {
                Min--;
                Stime = 59;
    
                StartCoroutine(CountDown());
            }
        }
    莫说我穷的叮当响,大袖揽清风。 莫讥我困时无处眠,天地做床被。 莫笑我渴时无美酒,江湖来做壶。
  • 相关阅读:
    Tensorflow io demo (待)
    tf.Dataset
    tf.estimator
    并发队列
    Callable的Future模式
    hadoop之HDFS介绍
    线程池
    并发工具类
    并发编程
    初学hadoop之hadoop集群搭建
  • 原文地址:https://www.cnblogs.com/huang--wei/p/11133748.html
Copyright © 2011-2022 走看看