主unity奔溃,上传lua修改、

master
罗家炜 2025-04-22 17:26:28 +08:00
parent 396ecbd69b
commit 1682cc668d
1 changed files with 17 additions and 6 deletions

View File

@ -165,11 +165,11 @@ function M:UpdateHandCard(getcard, mp)
self:__OnClickGetCard(context) self:__OnClickGetCard(context)
end) end)
else else
if i >= self._view_handCardList.numItems then -- if i >= self._view_handCardList.numItems then
btn_card = self._view_handCardList:AddItemFromPool() -- btn_card = self._view_handCardList:AddItemFromPool()
else -- else
btn_card = self._view_handCardList:GetChildAt(i) btn_card = self._view_handCardList:GetChildAt(i)
end -- end
end end
self:fillCard2(btn_card, handCardName, tem_card) self:fillCard2(btn_card, handCardName, tem_card)
local c_v = NewCardView(btn_card, tem_card) local c_v = NewCardView(btn_card, tem_card)
@ -280,6 +280,7 @@ end
function M:__OnClickHandCard(context) function M:__OnClickHandCard(context)
print("=======================lingmengclickhand") print("=======================lingmengclickhand")
self._ctr_seletedGet.selectedIndex = 0 self._ctr_seletedGet.selectedIndex = 0
self._click_index = self._view_handCardList.selectedIndex
local button = context.data local button = context.data
-- local _carViewList = self._carViewList -- local _carViewList = self._carViewList
-- for i = 1, #_carViewList do -- for i = 1, #_carViewList do
@ -288,9 +289,12 @@ function M:__OnClickHandCard(context)
-- end -- end
-- end -- end
local _room = DataManager.CurrenRoom local _room = DataManager.CurrenRoom
if (Utils.IsDoubleClick(context) and _room.curren_outcard_seat == _room.self_player.seat) then if ((Utils.IsDoubleClick(context) or self._click_index == self._view_handCardList.selectedIndex) and _room.curren_outcard_seat == _room.self_player.seat) then
local card = button.data local card = button.data
self._mainView:OutCard(card.card_item) self._mainView:OutCard(card.card_item)
self._view_handCardList.selectedIndex = -1
self._click_index = self._view_handCardList.selectedIndex
self._ctr_seletedGet.selectedIndex = 0
end end
end end
@ -307,6 +311,9 @@ function M:__OnClickGetCard(context)
if (Utils.IsDoubleClick(context) and _room.curren_outcard_seat == _room.self_player.seat) then if (Utils.IsDoubleClick(context) and _room.curren_outcard_seat == _room.self_player.seat) then
local card = button.data local card = button.data
self._mainView:OutCard(card.card_item) self._mainView:OutCard(card.card_item)
self._view_handCardList.selectedIndex = -1
self._click_index = self._view_handCardList.selectedIndex
self._ctr_seletedGet.selectedIndex = 0
end end
end end
@ -372,6 +379,10 @@ function M:Clear(bskip)
self._view_handCardList:RemoveChildrenToPool() self._view_handCardList:RemoveChildrenToPool()
self._view_outCardList:RemoveChildrenToPool() self._view_outCardList:RemoveChildrenToPool()
self._view_FZList:RemoveChildrenToPool() self._view_FZList:RemoveChildrenToPool()
self._view_handCardList.selectedIndex = -1
self._click_index = self._view_handCardList.selectedIndex
self._ctr_seletedGet.selectedIndex = 0
if bskip == nil or bskip == false then if bskip == nil or bskip == false then
self._mask_liangpai:RemoveChildren(0, -1, true) self._mask_liangpai:RemoveChildren(0, -1, true)
end end