探索提交
parent
dac88a6dbf
commit
5c51490cf5
|
@ -5231,7 +5231,7 @@ GameObject:
|
|||
- component: {fileID: 444452192568902440}
|
||||
- component: {fileID: 491492918089974590}
|
||||
m_Layer: 5
|
||||
m_Name: GeneralInfoPopup_ExploreMapTip (1)
|
||||
m_Name: GeneralInfoPopup_ExploreMapTip
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
|
|
|
@ -42,17 +42,17 @@ function GeneralSizeFitterPopup:BindEvent()
|
|||
end)
|
||||
end
|
||||
|
||||
function GeneralSizeFitterPopup:AddListener()
|
||||
for key, value in pairs(contentScripts) do
|
||||
value.view:AddListener()
|
||||
end
|
||||
end
|
||||
-- function GeneralSizeFitterPopup:AddListener()
|
||||
-- for key, value in pairs(contentScripts) do
|
||||
-- value.view:AddListener()
|
||||
-- end
|
||||
-- end
|
||||
|
||||
function GeneralSizeFitterPopup:RemoveListener()
|
||||
for key, value in pairs(contentScripts) do
|
||||
value.view:RemoveListener()
|
||||
end
|
||||
end
|
||||
-- function GeneralSizeFitterPopup:RemoveListener()
|
||||
-- for key, value in pairs(contentScripts) do
|
||||
-- value.view:RemoveListener()
|
||||
-- end
|
||||
-- end
|
||||
|
||||
function GeneralSizeFitterPopup:OnSortingOrderChange()
|
||||
this.sortingOrder = self.sortingOrder
|
||||
|
@ -68,6 +68,7 @@ end
|
|||
|
||||
function GeneralSizeFitterPopup:OnShow()
|
||||
contentScripts[this.popupKey].view:OnShow()
|
||||
contentScripts[this.popupKey].view:AddListener()
|
||||
end
|
||||
|
||||
function GeneralSizeFitterPopup:OnClose()
|
||||
|
|
|
@ -30,7 +30,7 @@ end
|
|||
|
||||
--移除事件监听(用于子类重写)
|
||||
function this:RemoveListener()
|
||||
Game.GlobalEvent:RemoveEvent(GameEvent.Explore.UpdateFormation,this.RefreshData)
|
||||
|
||||
end
|
||||
|
||||
--界面打开时调用(用于子类重写)
|
||||
|
@ -233,6 +233,7 @@ function this:OnClose()
|
|||
this.timer:Stop()
|
||||
this.timer = nil
|
||||
end
|
||||
Game.GlobalEvent:RemoveEvent(GameEvent.Explore.UpdateFormation,this.RefreshData)
|
||||
end
|
||||
|
||||
--界面销毁时调用(用于子类重写)
|
||||
|
|
|
@ -81,7 +81,7 @@ end
|
|||
|
||||
--移除事件监听(用于子类重写)
|
||||
function this:RemoveListener()
|
||||
Game.GlobalEvent:RemoveEvent(GameEvent.Explore.UpdateFormation,this.OnShow)
|
||||
|
||||
end
|
||||
|
||||
--界面打开时调用(用于子类重写)
|
||||
|
@ -415,6 +415,7 @@ function this:OnClose()
|
|||
end
|
||||
this.SetPos(this.mapTip,nil,this.formationId)
|
||||
this.SetPos(this.mapTimeTip,nil,this.formationId)
|
||||
Game.GlobalEvent:RemoveEvent(GameEvent.Explore.UpdateFormation,this.OnShow)
|
||||
end
|
||||
|
||||
--界面销毁时调用(用于子类重写)
|
||||
|
|
|
@ -8,10 +8,10 @@ local propertyConfig = ConfigManager.GetConfig(ConfigName.PropertyConfig)
|
|||
--初始化组件(用于子类重写)
|
||||
function this:InitComponent(gameObject)
|
||||
this.spLoader = SpriteLoader.New()
|
||||
self.gameObject = gameObject
|
||||
self.itemPre = Util.GetGameObject(gameObject, "tipPre")
|
||||
self.titleName = Util.GetGameObject(gameObject, "titleName"):GetComponent("Text")
|
||||
self.itemList = {}
|
||||
this.gameObject = gameObject
|
||||
this.itemPre = Util.GetGameObject(gameObject, "tipPre")
|
||||
this.titleName = Util.GetGameObject(gameObject, "titleName"):GetComponent("Text")
|
||||
this.itemList = {}
|
||||
end
|
||||
|
||||
--绑定事件(用于子类重写)
|
||||
|
@ -31,66 +31,66 @@ function this:OnShow(_parent,...)
|
|||
parent=_parent
|
||||
sortingOrder = _parent.sortingOrder
|
||||
local _args = {...}
|
||||
self.data = _args[1]
|
||||
self:Refresh()
|
||||
this.data = _args[1]
|
||||
this:Refresh()
|
||||
end
|
||||
|
||||
function this:Refresh()
|
||||
if self.data.name and self.data.name ~= "" then
|
||||
self.titleName.text = self.data.name
|
||||
self.titleName.gameObject:SetActive(true)
|
||||
if this.data.name and this.data.name ~= "" then
|
||||
this.titleName.text = this.data.name
|
||||
this.titleName.gameObject:SetActive(true)
|
||||
else
|
||||
self.titleName.gameObject:SetActive(false)
|
||||
this.titleName.gameObject:SetActive(false)
|
||||
end
|
||||
|
||||
for i = 1,math.max(#self.data.showData,#self.itemList) do
|
||||
if not self.data.showData[i] then
|
||||
self.itemList[i].go.gameObject:SetActive(false)
|
||||
for i = 1,math.max(#this.data.showData,#this.itemList) do
|
||||
if not this.data.showData[i] then
|
||||
this.itemList[i].go.gameObject:SetActive(false)
|
||||
else
|
||||
if not self.itemList[i] then
|
||||
self.itemList[i] = {}
|
||||
self.itemList[i].go = newObjToParent(self.itemPre,self.gameObject)
|
||||
self.itemList[i].tip = Util.GetGameObject(self.itemList[i].go, "tip1Pre")
|
||||
self.itemList[i].scroll = Util.GetGameObject(self.itemList[i].go, "scroll")
|
||||
self.itemList[i].scrollGrid = Util.GetGameObject(self.itemList[i].go, "scroll/cost")
|
||||
self.itemList[i].cost = {}
|
||||
self.itemList[i].tips = {}
|
||||
if not this.itemList[i] then
|
||||
this.itemList[i] = {}
|
||||
this.itemList[i].go = newObjToParent(this.itemPre,this.gameObject)
|
||||
this.itemList[i].tip = Util.GetGameObject(this.itemList[i].go, "tip1Pre")
|
||||
this.itemList[i].scroll = Util.GetGameObject(this.itemList[i].go, "scroll")
|
||||
this.itemList[i].scrollGrid = Util.GetGameObject(this.itemList[i].go, "scroll/cost")
|
||||
this.itemList[i].cost = {}
|
||||
this.itemList[i].tips = {}
|
||||
end
|
||||
self.itemList[i].go.gameObject:SetActive(true)
|
||||
local singledata = self.data.showData[i]
|
||||
this.itemList[i].go.gameObject:SetActive(true)
|
||||
local singledata = this.data.showData[i]
|
||||
if singledata.tips then
|
||||
for j = 1,math.max(#singledata.tips,#self.itemList[i].tips) do
|
||||
for j = 1,math.max(#singledata.tips,#this.itemList[i].tips) do
|
||||
if not singledata.tips[j] then
|
||||
self.itemList[i].tips[j].gameObject:SetActive(false)
|
||||
this.itemList[i].tips[j].gameObject:SetActive(false)
|
||||
else
|
||||
if not self.itemList[i].tips[j] then
|
||||
self.itemList[i].tips[j] = newObjToParent(self.itemList[i].tip,self.itemList[i].go):GetComponent("Text")
|
||||
if not this.itemList[i].tips[j] then
|
||||
this.itemList[i].tips[j] = newObjToParent(this.itemList[i].tip,this.itemList[i].go):GetComponent("Text")
|
||||
end
|
||||
self.itemList[i].tips[j].gameObject:SetActive(true)
|
||||
self.itemList[i].tips[j].text = singledata.tips[j]
|
||||
this.itemList[i].tips[j].gameObject:SetActive(true)
|
||||
this.itemList[i].tips[j].text = singledata.tips[j]
|
||||
end
|
||||
end
|
||||
else
|
||||
for j = 1,#self.itemList[i].tips do
|
||||
self.itemList[i].tips[j].gameObject:SetActive(false)
|
||||
for j = 1,#this.itemList[i].tips do
|
||||
this.itemList[i].tips[j].gameObject:SetActive(false)
|
||||
end
|
||||
end
|
||||
self.itemList[i].scroll.transform:SetAsLastSibling()
|
||||
this.itemList[i].scroll.transform:SetAsLastSibling()
|
||||
if singledata.reward and #singledata.reward > 0 then
|
||||
self.itemList[i].scroll.gameObject:SetActive(true)
|
||||
for j = 1,math.max(#singledata.reward,#self.itemList[i].cost) do
|
||||
this.itemList[i].scroll.gameObject:SetActive(true)
|
||||
for j = 1,math.max(#singledata.reward,#this.itemList[i].cost) do
|
||||
if not singledata.reward[j] then
|
||||
self.itemList[i].cost[j].gameObject:SetActive(false)
|
||||
this.itemList[i].cost[j].gameObject:SetActive(false)
|
||||
else
|
||||
if not self.itemList[i].cost[j] then
|
||||
self.itemList[i].cost[j] = SubUIManager.Open(SubUIConfig.ItemView,self.itemList[i].scrollGrid.transform)
|
||||
if not this.itemList[i].cost[j] then
|
||||
this.itemList[i].cost[j] = SubUIManager.Open(SubUIConfig.ItemView,this.itemList[i].scrollGrid.transform)
|
||||
end
|
||||
self.itemList[i].cost[j].gameObject:SetActive(true)
|
||||
self.itemList[i].cost[j]:OnOpen(false, {singledata.reward[j],0}, 0.65,false,false,false,self.sortingOrder)
|
||||
this.itemList[i].cost[j].gameObject:SetActive(true)
|
||||
this.itemList[i].cost[j]:OnOpen(false, {singledata.reward[j],0}, 0.65,false,false,false,this.sortingOrder)
|
||||
end
|
||||
end
|
||||
else
|
||||
self.itemList[i].scroll.gameObject:SetActive(false)
|
||||
this.itemList[i].scroll.gameObject:SetActive(false)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
@ -103,12 +103,12 @@ end
|
|||
--界面销毁时调用(用于子类重写)
|
||||
function this:OnDestroy()
|
||||
this.spLoader:Destroy()
|
||||
for i = 1,#self.itemList do
|
||||
for j = 1,#self.itemList[i].cost do
|
||||
SubUIManager.Close(self.itemList[i].cost[j])
|
||||
for i = 1,#this.itemList do
|
||||
for j = 1,#this.itemList[i].cost do
|
||||
SubUIManager.Close(this.itemList[i].cost[j])
|
||||
end
|
||||
end
|
||||
self.itemList = {}
|
||||
this.itemList = {}
|
||||
end
|
||||
|
||||
return this
|
|
@ -6332,7 +6332,6 @@ function NetManager.ExplorerMapSendRequest(_data,fun)
|
|||
data2.mapId = v.mapId
|
||||
data2.teamId = v.formationId
|
||||
data2.time = v.exploreTime
|
||||
LogGreen("this.mapData.mapId:"..tostring(v.mapId).." this.formation.formationId:"..tostring(v.formationId).." this.exploreTime:"..tostring(v.exploreTime))
|
||||
end
|
||||
local msg = data:SerializeToString()
|
||||
Network:SendMessageWithCallBack(MessageTypeProto_pb.ExplorerMapSendRequest, MessageTypeProto_pb.ExplorerMapSendResponse, msg, function(buffer)
|
||||
|
|
Loading…
Reference in New Issue