| | |
| | | } |
| | | } |
| | | |
| | | // 通过货币类型获取物品ID |
| | | public static int GetItemIDWithMoneyType(int moneyType) |
| | | { |
| | | if (GeneralDefine.MoneyDisplayModel.ContainsKey(moneyType)) |
| | | { |
| | | return GeneralDefine.MoneyDisplayModel[moneyType]; |
| | | } |
| | | else |
| | | { |
| | | Debug.LogError("MoneyDisplayModel 未配置货币类型:" + moneyType); |
| | | return 0; |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 分离字符串插入空格 |
| | | /// </summary> |
| | |
| | | } |
| | | |
| | | //显示数量, 格式n/m, 足够绿色不足红色 |
| | | public static string ShowUseMoney(int moneyType, long useCnt, bool showLargeNum = true) |
| | | public static string ShowUseMoney(int moneyType, long useCnt, bool showLargeNum = false) |
| | | { |
| | | long cnt = GetMoneyCnt(moneyType); |
| | | if (showLargeNum) |
| | |
| | | return AppendColor(useCnt <= cnt ? TextColType.Green : TextColType.Red, $"{cnt}/{useCnt}"); |
| | | } |
| | | |
| | | public static string ShowUseItem(PackType type, int itemId, long useCnt, bool showLargeNum = true) |
| | | public static string ShowUseItem(PackType type, int itemId, long useCnt, bool showLargeNum = false) |
| | | { |
| | | long cnt = PackManager.Instance.GetItemCountByID(type, itemId); |
| | | if (showLargeNum) |