创建时间

 private string timerValue = "0:00:00";         
    // Use this for initialization     
    void Start()     
    {         
        InvokeRepeating("TimerUpdate", 1.0f, 0.13f);
        timerSkin = (GUISkin)Resources.Load("TimerGUISkin");    
    }

    private void TimerUpdate()   
    {         
        float minutes = Mathf.FloorToInt(Time.time / 60);        
        float seconds = Time.time % 60;         
        timerValue = string.Format("{0:00}:{1:00.00}", minutes, seconds);   
    }

posted @ 2012-04-17 16:23  渡蓝  阅读(209)  评论(0编辑  收藏  举报