|
@@ -148,6 +148,7 @@ namespace GFGGame
|
|
|
uiItemChild.m_txtSelNum.onFocusOut.Add(OnChangedTxtSelNum);
|
|
|
uiItemChild.m_btnAdd.onClick.Add(OnBtnAddClick);
|
|
|
uiItemChild.m_btnReduce.onClick.Add(OnChildBtnReduceClick);
|
|
|
+ uiItemChild.m_btnReduce.onTouchBegin.Add(OnTextInputOpen);
|
|
|
|
|
|
if (uiItemChild.target.data == null)
|
|
|
{
|
|
@@ -234,6 +235,20 @@ namespace GFGGame
|
|
|
UpdateReduceSel(listItem, itemCfg);
|
|
|
}
|
|
|
|
|
|
+ private void OnTextInputOpen(EventContext context)
|
|
|
+ {
|
|
|
+ GObject sender = context.sender as GObject;
|
|
|
+ GObject obj = sender.parent;
|
|
|
+ UI_ListSelectorItem listItem = UI_ListSelectorItem.Proxy(obj);
|
|
|
+
|
|
|
+ // 当触摸输入框时执行的逻辑
|
|
|
+ if (listItem.m_txtSelNum.text == "0")
|
|
|
+ {
|
|
|
+ // 将文本设置为空字符串
|
|
|
+ listItem.m_txtSelNum.text = "";
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
private void OnLongPressReduce(EventContext context)
|
|
|
{
|
|
|
LongPressGesture gesture = (LongPressGesture)context.sender;
|