宝箱状态修改

dev_chengFeng
jiaoyangna 2021-03-12 18:18:25 +08:00
parent 388f68d39d
commit 8656408ac9
2 changed files with 9 additions and 15 deletions

View File

@ -155,11 +155,7 @@ function SheJiDaDian:BindEvent()
Util.AddOnceClick(this.btnBox,function ()
DynamicActivityManager.SetCurLevel(math.floor(curScore/(actReward[1].Values[2][1])))
UIManager.OpenPanel(UIName.GeneralRewardPopup,1,ActivityTypeDef.Celebration,activityId,function()
ActInfo = ActivityGiftManager.GetActivityTypeInfo(ActivityTypeDef.Celebration)--活动数据
activityId = ActInfo.activityId
this:RefreshRewardBox()
end)
UIManager.OpenPanel(UIName.GeneralRewardPopup,1,ActivityTypeDef.Celebration,activityId)
end)
end
@ -205,20 +201,17 @@ function this:RefreshItemsData()
end
function this:RefreshRewardBox()
canGetRewardList={}
this.boxEffect:SetActive(false)
this.btnBox:GetComponent("Image").enabled = true
for i = 1, #ActInfo.mission do
local curLevel = curScore/actReward[1].Values[2][1]
if ActInfo.mission[i].state == 0 and curLevel >= i then
table.insert(canGetRewardList,ActInfo.mission[i])
if ActInfo.mission[i].state == 0 and curLevel >= ConfigManager.GetConfigData(ConfigName.ActivityRewardConfig,ActInfo.mission[i].missionId).Sort then
this.boxEffect:SetActive(true)
this.btnBox:GetComponent("Image").enabled = false
return
end
end
if #canGetRewardList > 0 then
this.boxEffect:SetActive(true)
this.btnBox:GetComponent("Image").enabled = false
end
end
--点击或长按处理升级处理
@ -407,6 +400,8 @@ end
function this:OnSortingOrderChange(_sortingOrder)
orginLayer = _sortingOrder
Util.AddParticleSortLayer(this.boxEffect,_sortingOrder - orginLayer)
orginLayer = _sortingOrder
end
function this:OnHide()

View File

@ -80,11 +80,10 @@ function GeneralRewardPopup:OnShow()
end
function GeneralRewardPopup:OnClose()
Game.GlobalEvent:DispatchEvent(GameEvent.DynamicTask.OnGetReward)
if func then
func()
func = nil
end
end
Game.GlobalEvent:DispatchEvent(GameEvent.DynamicTask.OnGetReward)
end
function GeneralRewardPopup:OnDestroy()