yyl
8 天以前 3bd7f56906e31e8fe0072108c9d4652707b51de8
Main/Utility/TimeUtility.cs
@@ -252,6 +252,30 @@
        return StringUtility.Contact(hours.ToString("D2"), ":", mins.ToString("D2"), ":", seconds.ToString("D2"));
    }
    //详细显示
    //xx小时xx分XX秒
    //xx分XX秒
    //xx秒
    public static string SecondsToHMSEx(int _seconds)
    {
        int hours = _seconds % 86400 / 3600;
        int mins = _seconds % 3600 / 60;
        int seconds = _seconds % 60;
        if (hours > 0)
        {
            return StringUtility.Contact(hours, Language.Get("L1072"), mins, Language.Get("L1073"), seconds, Language.Get("L1075"));
        }
        else if (mins > 0)
        {
            return StringUtility.Contact(mins, Language.Get("L1073"), seconds, Language.Get("L1075"));
        }
        else
        {
            return StringUtility.Contact(seconds, Language.Get("L1075"));
        }
    }
    //例子;分:秒
    //xx:xx
    public static string SecondsToMS(int _seconds)
@@ -345,8 +369,8 @@
    }
    //极简显示
    // x天x小时
    // x小时x分
    // x天 或者 x天x小时
    // x小时 或者 x小时x分
    // x分
    // x秒
    public static string SecondsToShortDHMS(int _seconds)
@@ -357,10 +381,18 @@
        int seconds = _seconds % 60;
        if (days > 0)
        {
            if (hours == 0)
            {
                return StringUtility.Contact(days, Language.Get("L1074"));
            }
            return StringUtility.Contact(days, Language.Get("L1074"), hours, Language.Get("L1072"));
        }
        else if (hours > 0)
        {
            if (mins == 0)
            {
                return StringUtility.Contact(hours, Language.Get("L1072"));
            }
            return StringUtility.Contact(hours, Language.Get("L1072"), mins, Language.Get("L1073"));
        }
        else if (mins > 0)
@@ -387,10 +419,12 @@
        }
        return StringUtility.Contact(hours.ToString("D2"), ":", mins.ToString("D2"), ":", seconds.ToString("D2"));
    }
    //例子
    //x天
    //x时
    //x分x秒
    //x分
    //x秒
    public static string SecondsToConsumeRebate(int _seconds)
    {
@@ -404,15 +438,15 @@
        }
        else if (hours >= 1)
        {
            return StringUtility.Contact(Mathf.CeilToInt(hours), Language.Get("Hour"));
            return StringUtility.Contact(Mathf.CeilToInt(hours), Language.Get("L1072"));
        }
        else if (mins >= 1)
        {
            return StringUtility.Contact(mins, Language.Get("Minute"), seconds, Language.Get("RealmWin_Bewrite_35"));
            return StringUtility.Contact(mins, Language.Get("L1073"));
        }
        else
        {
            return StringUtility.Contact(seconds, Language.Get("RealmWin_Bewrite_35"));
            return StringUtility.Contact(seconds, Language.Get("L1075"));
        }
    }