|
@@ -246,9 +246,9 @@ namespace GFGGame
|
|
|
if (listItem.m_txtSelNum.text == "0")
|
|
|
{
|
|
|
// 将文本设置为空字符串
|
|
|
- listItem.m_txtSelNum.text = "";
|
|
|
- // 延迟 0.1 秒后恢复文本
|
|
|
- Timers.inst.Add(0.1f, 1, (obj) => { listItem.m_txtSelNum.text = ""; });
|
|
|
+ listItem.m_txtSelNum.text = " ";
|
|
|
+ // 延迟 0.2 秒后恢复文本
|
|
|
+ Timers.inst.Add(0.2f, 1, (obj) => { listItem.m_txtSelNum.text = " "; });
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -309,7 +309,8 @@ namespace GFGGame
|
|
|
|
|
|
private void UpdateSelNumSel(UI_ListSelectorItem listItem, ItemCfg itemCfg)
|
|
|
{
|
|
|
- if (string.IsNullOrEmpty(listItem.m_txtSelNum.text))
|
|
|
+ bool isNumeric = int.TryParse(listItem.m_txtSelNum.text, out var result);
|
|
|
+ if (!isNumeric)
|
|
|
{
|
|
|
listItem.m_txtSelNum.text = "0";
|
|
|
}
|