| | |
| | | /// </summary> |
| | | public static string ReplaceLargeNum(double num, int decimalPlaces = 1) |
| | | { |
| | | const long K = 10000; //国内为万,海外为千 |
| | | const long M = K * 10000; |
| | | const long B = M * 10000; |
| | | const long T = B * 10000; |
| | | // 获取当前语言状态 |
| | | string langId = Language.Id; |
| | | bool isChinese = langId == "zh" || langId == "ft"; |
| | | |
| | | // 简繁中文万进制 (10000),其他千进制 (1000) |
| | | long baseUnit = isChinese ? 10000 : 1000; |
| | | |
| | | long K = baseUnit; |
| | | long M = K * baseUnit; |
| | | long B = M * baseUnit; |
| | | long T = B * baseUnit; |
| | | |
| | | if (num >= T) |
| | | { |
| | |
| | | //用于美术字 统一用字母KMBT代表使用,小数点用. |
| | | public static string ReplaceLargeArtNum(double num) |
| | | { |
| | | const long K = 10000; //国内为万,海外为千 |
| | | const long M = K * 10000; |
| | | const long B = M * 10000; |
| | | const long T = B * 10000; |
| | | // 获取当前语言状态 |
| | | string langId = Language.Id; |
| | | bool isChinese = langId == "zh" || langId == "ft"; |
| | | |
| | | // 简繁中文万进制 (10000),其他千进制 (1000) |
| | | long baseUnit = isChinese ? 10000 : 1000; |
| | | |
| | | long K = baseUnit; |
| | | long M = K * baseUnit; |
| | | long B = M * baseUnit; |
| | | long T = B * baseUnit; |
| | | |
| | | if (num >= T) |
| | | { |
| | |
| | | serverList.Add(serverName); |
| | | //太长会导致界面顶点数超过65000 |
| | | if (serverList.Count > 1000) |
| | | return string.Join(", ", serverList.ToArray()); |
| | | return string.Join(", ", serverList); |
| | | } |
| | | } |
| | | return string.Join(", ", serverList.ToArray()); |
| | | return string.Join(", ", serverList); |
| | | } |
| | | |
| | | //不同版本现金的单位不一样,比如越南盾是整数,下发是原值;美元和RMB是小数,下发是原值的100 |
| | |
| | | return content; |
| | | } |
| | | |
| | | //复制到剪贴板 |
| | | // TODO 暂不支持web后续补充 |
| | | |
| | | |
| | | public static void CopyToClipboard(string text) |
| | | { |
| | | #if UNITY_WEBGL && !UNITY_EDITOR |
| | | LaunchUtility.UIHelper_CopyToClipboard(text); |
| | | #else |
| | | GUIUtility.systemCopyBuffer = text; |
| | | #endif |
| | | Debug.Log("文字已复制到剪贴板: " + text); |
| | | } |
| | | |
| | | //获取剪切板内容 |
| | | public static string GetClipboardText() |
| | | { |
| | | #if UNITY_WEBGL && !UNITY_EDITOR |
| | | // WebGL下浏览器安全限制,无法同步读取剪贴板 |
| | | return string.Empty; |
| | | #else |
| | | return GUIUtility.systemCopyBuffer; |
| | | #endif |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | UIManager.Instance.CloseWindow<ServersSmallTipWin>(); |
| | | } |
| | | ServersSmallTipWin.serverIDList = serverIDList; |
| | | UIManager.Instance.OpenWindow<ServersSmallTipWin>(); |
| | | UIManager.Instance.OpenWindowAsync<ServersSmallTipWin>().Forget(); |
| | | } |
| | | |
| | | } |