You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

20 lines
498 B
C#

using UnityEngine;
namespace Script.FrameWork
{
public static class Util
{
public static string FormatTime(float timeS)
{
var t = Mathf.CeilToInt(timeS);
if (t <= 0)
t = 0;
var hour = t / 3600;
var minute = (t - hour * 3600) / 60;
var second = t % 60;
if (hour > 0)
return $"{hour} : {minute} : {second}";
return $"{minute} : {second}";
}
}
}