刷冲特权优化,通关某关卡添加空判断

wangzhenxing 2022-11-04 15:40:41 +08:00
parent 07f7aa5f41
commit b73735f7cb
3 changed files with 20 additions and 12 deletions

View File

@ -12,7 +12,7 @@ GameObject:
- component: {fileID: 5282930794667940139}
- component: {fileID: 3567283505001742107}
m_Layer: 5
m_Name: Rewardbg (1)
m_Name: Rewardbg
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0

View File

@ -109,26 +109,27 @@ end
function this.IsFightPointPass(fightId)
local isPass = false
local curDiff = mainLevelConfig[this.curOpenFight].Difficulty
local judgeDiff = mainLevelConfig[fightId].Difficulty
if curDiff == judgeDiff then
if mainLevelConfig[fightId] then
local judgeDiff = mainLevelConfig[fightId].Difficulty
if curDiff == judgeDiff then
if fightId < this.curOpenFight then
isPass = true
elseif fightId == this.curOpenFight then
if this.curFightState == 2 then -- 最后一章的最后一关
if fightId < this.curOpenFight then
isPass = true
elseif fightId == this.curOpenFight then
if this.curFightState == 2 then -- 最后一章的最后一关
isPass = true
else
isPass = false
end
else
isPass = false
end
elseif curDiff > judgeDiff then
isPass = true
else
isPass = false
end
elseif curDiff > judgeDiff then
isPass = true
else
isPass = false
end
return isPass
end

View File

@ -37,6 +37,8 @@ function GMShuaChongTeQuan:InitComponent()
self.rewardGrid=Util.GetGameObject(self.gameObject, "bg1/bg2/Reward")
self.dayGrid=Util.GetGameObject(self.gameObject, "bg1/bg2/dayReward")
self.payTxt=Util.GetGameObject(self.gameObject, "bg1/bg2/btn_buy/Text"):GetComponent("Text")
self.hint2Txt=Util.GetGameObject(self.gameObject, "bg1/bg2/Rewardbg/Text"):GetComponent("Text")
self.oldPriceTxt=Util.GetGameObject(self.gameObject, "bg1/bg2/btn_buy/old_buy"):GetComponent("Text")
local rootHight = self.infoGrid.transform.rect.height
local width = self.infoGrid.transform.rect.width
self.ScrollView = SubUIManager.Open(SubUIConfig.ScrollCycleView, self.infoGrid.transform,self.infoPre, nil, Vector2.New(width, rootHight), 1, 1, Vector2.New(0,0))
@ -58,12 +60,17 @@ function GMShuaChongTeQuan:InitComponent()
local len=#recharge.OpenPrivilege
local mission=ActivityGiftManager.GetActivityInfo(ActivityTypeDef.shuaChongTeQuan,activityId)
local state=mission.state
self.oldPriceTxt.text=recharge.Price*10 ..""
if state==0 then
self.payTxt.text=recharge.Price..""
self.hint2Txt.gameObject:SetActive(true)
self.hint2Txt.text="已累计"..mission.progress.."天奖励奖励最多累计30天"
elseif state==1 then
self.payTxt.text="领取"
self.hint2Txt.gameObject:SetActive(false)
elseif state==2 then
self.payTxt.text="已领取"
self.hint2Txt.gameObject:SetActive(false)
end
if _index>1 then
local lastId=_TabData[_index-1].id