探索提交

dev_chengFeng
jiaoyangna 2021-12-27 16:31:38 +08:00
parent 9e47928008
commit b3c0ea78ab
1 changed files with 20 additions and 5 deletions

View File

@ -111,6 +111,7 @@ function this:OnShow(_parent,...)
this.itemList[i].targgetTimeBtn = Util.GetGameObject(this.itemList[i].formation, "targgetTimeBtn")
this.itemList[i].targgetTimeBtnText = Util.GetGameObject(this.itemList[i].targgetTimeBtn, "Text"):GetComponent("Text")
this.itemList[i].scroll = Util.GetGameObject(this.itemList[i].formation, "scroll")
this.itemList[i].cost = Util.GetGameObject(this.itemList[i].formation, "cost")
this.itemList[i].costIcon = Util.GetGameObject(this.itemList[i].formation, "cost/icon"):GetComponent("Image")
this.itemList[i].costNum = Util.GetGameObject(this.itemList[i].formation, "cost/num"):GetComponent("Text")
this.itemList[i].targgetRoot = Util.GetGameObject(this.itemList[i].formation, "tagetpos")
@ -190,9 +191,14 @@ end
function this.SetExploreCost(forId)
if forId then
this.itemList[this.formationList[forId].index].costIcon.sprite = this.spLoader:LoadSprite(GetSpriteNameByItemId(Explore[this.formationList[forId].mapId].Cost[1]))
this.formationList[forId].costNum = Explore[this.formationList[forId].mapId].Cost[2] * (this.formationList[forId].exploreTime * 60)
this.itemList[this.formationList[forId].index].costNum.text = this.formationList[forId].costNum
if this.formationList[forId].select == -1 then
this.formationList[forId].cost.gameObject:SetActive(false)
else
this.formationList[forId].cost.gameObject:SetActive(true)
this.itemList[this.formationList[forId].index].costIcon.sprite = this.spLoader:LoadSprite(GetSpriteNameByItemId(Explore[this.formationList[forId].mapId].Cost[1]))
this.formationList[forId].costNum = Explore[this.formationList[forId].mapId].Cost[2] * (this.formationList[forId].exploreTime * 60)
this.itemList[this.formationList[forId].index].costNum.text = this.formationList[forId].costNum
end
end
local num = 0
for k,v in pairs(this.formationList) do
@ -278,7 +284,9 @@ function this:Refresh(_data,_item,index)
_item.targgetTimeBtn.gameObject:SetActive(true)
else
_item.exploring.gameObject:SetActive(true)
this.formationList[_data.formationId].select = 0
this.formationList[_data.formationId].select = -1
this.formationList[_data.formationId].mapId = this.mapDatas[1].mapId
this.formationList[_data.formationId].exploreTime = this.mapDatas[1].exploreTime
_item.targgetTimeBtn.gameObject:SetActive(false)
end
this.SetMapName(_data.formationId)
@ -303,7 +311,14 @@ function this:Refresh(_data,_item,index)
Util.AddOnceClick(_item.exploring,function()
if _data.state > 0 then
--停止探索
NetManager.ExplorerMapRewardRequest(0,_data.formationId,function(drop)
UIManager.OpenPanel(UIName.RewardItemPopup,drop,1,function()
_data.state = 0
_data.exploreTime = 0
_data.mapId = 0
self:Refresh(_data,_item,index)
end)
end)
end
end)
end