| | |
| | | using System.Text; |
| | | using UnityEngine; |
| | | using System.Linq; |
| | | using System.Xml.Linq; |
| | | using System.Collections; |
| | | using System.Collections.Generic; |
| | | using UnityEngine.UI; |
| | | |
| | |
| | | } |
| | | else if (num >= M) |
| | | { |
| | | return StringUtility.Contact(numto2Decimals(num / M).ToString("0.##"), Language.Get("L1070")); |
| | | return StringUtility.Contact(numto2Decimals(num / M).ToString("0.#"), Language.Get("L1070")); |
| | | } |
| | | else if (num >= K) |
| | | { |
| | | return StringUtility.Contact(numto2Decimals(num / K).ToString("0.##"), Language.Get("L1071")); |
| | | return StringUtility.Contact(numto2Decimals(num / K).ToString("0.#"), Language.Get("L1071")); |
| | | } |
| | | else |
| | | { |
| | | return numto2Decimals(num).ToString("0.##"); |
| | | return numto2Decimals(num).ToString("0.#"); |
| | | } |
| | | } |
| | | |
| | |
| | | } |
| | | else if (num >= M) |
| | | { |
| | | return StringUtility.Contact(numto2Decimals(num / M).ToString("0.##"),"m"); |
| | | return StringUtility.Contact(numto2Decimals(num / M).ToString("0.#"), "m"); |
| | | } |
| | | else if (num >= K) |
| | | { |
| | | return StringUtility.Contact(numto2Decimals(num / K).ToString("0.##"), "k"); |
| | | return StringUtility.Contact(numto2Decimals(num / K).ToString("0.#"), "k"); |
| | | } |
| | | else |
| | | { |
| | | return numto2Decimals(num).ToString("0.##"); |
| | | return numto2Decimals(num).ToString("0.#"); |
| | | } |
| | | } |
| | | |
| | |
| | | // return name; |
| | | // } |
| | | |
| | | //物品 各功能品质 |
| | | public static Color GetUIColorByFunc(int itemColor, bool bright = false) |
| | | { |
| | | return GetUIColor(itemColor + 1, bright); |
| | | } |
| | | |
| | | |
| | | //对应品质(树);物品 各功能品质从2开始 用GetUIColorByFunc |
| | | public static Color GetUIColor(int itemColor, bool bright = false) |
| | | { |
| | | switch (itemColor) |
| | |
| | | case 11: |
| | | return GetUIColor(TextColType.itembuxiu, bright); |
| | | case 12: |
| | | return GetUIColor(TextColType.itemyonghen, bright); |
| | | return GetUIColor(TextColType.itemyonghen, bright); |
| | | |
| | | |
| | | } |
| | |
| | | return bright ? s_BrightWhiteColor : s_DarkWhiteColor; |
| | | } |
| | | |
| | | //对应品质(树);物品 各功能品质从2开始 用GetUIOutlineColorByFunc |
| | | public static Color GetUIOutlineColor(int quality) |
| | | { |
| | | return GetUIOutlineColor((QualityTextColType)quality); |
| | | } |
| | | |
| | | //描边颜色,对应品质 |
| | | //物品 各功能品质 |
| | | public static Color GetUIOutlineColorByFunc(int quality) |
| | | { |
| | | return GetUIOutlineColor((QualityTextColType)(quality + 1)); |
| | | } |
| | | |
| | | //描边颜色,对应品质(树) |
| | | public static Color GetUIOutlineColor(QualityTextColType type) |
| | | { |
| | | switch (type) |
| | | { |
| | | case QualityTextColType.itemcucao: |
| | | // 2d2d2d 粗糙 |
| | | return new Color32(45, 45, 45, 255); |
| | | return new Color32(45, 45, 45, 128); |
| | | case QualityTextColType.itemputong: |
| | | // 424242 普通 |
| | | return new Color32(66, 66, 66, 255); |
| | | return new Color32(66, 66, 66, 128); |
| | | case QualityTextColType.itemjingliang: |
| | | // 172543 精良 |
| | | return new Color32(23, 37, 67, 255); |
| | | return new Color32(23, 37, 67, 128); |
| | | case QualityTextColType.itemxiyou: |
| | | // 2a0f30 稀有 |
| | | return new Color32(42, 15, 48, 255); |
| | | return new Color32(42, 15, 48, 128); |
| | | case QualityTextColType.itemshishi: |
| | | // 4a2f00 史诗 |
| | | return new Color32(74, 47, 0, 255); |
| | | return new Color32(74, 47, 0, 128); |
| | | case QualityTextColType.itemchuanqi: |
| | | // 451800 传奇 |
| | | return new Color32(69, 24, 0, 255); |
| | | return new Color32(69, 24, 0, 128); |
| | | case QualityTextColType.itemshenhua: |
| | | // 510000 神话 |
| | | return new Color32(81, 0, 0, 255); |
| | | return new Color32(81, 0, 0, 128); |
| | | case QualityTextColType.itemwuxia: |
| | | // 43003e 无瑕 |
| | | return new Color32(67, 0, 62, 255); |
| | | return new Color32(67, 0, 62, 128); |
| | | case QualityTextColType.itemanjin: |
| | | // 6f4401 暗金 |
| | | return new Color32(111, 68, 1, 255); |
| | | return new Color32(111, 68, 1, 128); |
| | | case QualityTextColType.itemjueyi: |
| | | // 203995 绝艺 |
| | | return new Color32(32, 57, 149, 255); |
| | | return new Color32(32, 57, 149, 128); |
| | | case QualityTextColType.itemyuanzu: |
| | | // 461f5d 元祖 |
| | | return new Color32(70, 31, 93, 255); |
| | | return new Color32(70, 31, 93, 128); |
| | | case QualityTextColType.itembuxiu: |
| | | // 2e3975 不朽 |
| | | return new Color32(46, 57, 117, 255); |
| | | return new Color32(46, 57, 117, 128); |
| | | case QualityTextColType.itemyonghen: |
| | | // 5d1d52 永恒 |
| | | return new Color32(93, 29, 82, 255); |
| | | return new Color32(93, 29, 82, 128); |
| | | case QualityTextColType.red: |
| | | return s_BrightRedColor; |
| | | } |
| | | return new Color32(0, 0, 0, 255); |
| | | return new Color32(0, 0, 0, 128); |
| | | } |
| | | |
| | | private static Regex m_TextColorRegex = new Regex("<color=#[0-9a-zA-Z]+>(.*)</color>", RegexOptions.Singleline); |