- 最后登录
- 2017-5-15
- 注册时间
- 2012-3-1
- 阅读权限
- 90
- 积分
- 32973
  
- 纳金币
- 32806
- 精华
- 12
|
非常简短的一段小代码
/// Formats the input string (in seconds) as a human readable
/// string in the form of MM:SS.
/// A of the current playing time.
private string formatedTimeString (string input) {
int seconds;
int minutes;
minutes = Mathf.FloorToInt(input / 60);
seconds = Mathf.FloorToInt(input - minutes * 60);
string r = (minutes < 10) ? "0" + minutes.ToString() : minutes.ToString();
r += ":";
r += (seconds < 10) ? "0" + seconds.ToString() : seconds.ToString();
return r;
} |
|