修改提交

jiaoyangna 2020-10-15 19:41:47 +08:00
parent c8a9f3f8db
commit 598ca9e91f
8 changed files with 63 additions and 27 deletions

View File

@ -533,7 +533,7 @@ Canvas:
m_PlaneDistance: 100 m_PlaneDistance: 100
m_PixelPerfect: 0 m_PixelPerfect: 0
m_ReceivesEvents: 1 m_ReceivesEvents: 1
m_OverrideSorting: 0 m_OverrideSorting: 1
m_OverridePixelPerfect: 0 m_OverridePixelPerfect: 0
m_SortingBucketNormalizedSize: 0 m_SortingBucketNormalizedSize: 0
m_AdditionalShaderChannelsFlag: 0 m_AdditionalShaderChannelsFlag: 0

View File

@ -227,6 +227,7 @@ JOURNEYRANDOMRESPONSE_NEXTRANDOM_FIELD = protobuf.FieldDescriptor();
JOURNEYRANDOMRESPONSE_COUNT_FIELD = protobuf.FieldDescriptor(); JOURNEYRANDOMRESPONSE_COUNT_FIELD = protobuf.FieldDescriptor();
JOURNEYBUYREQUEST = protobuf.Descriptor(); JOURNEYBUYREQUEST = protobuf.Descriptor();
JOURNEYBUYREQUEST_MAPID_FIELD = protobuf.FieldDescriptor(); JOURNEYBUYREQUEST_MAPID_FIELD = protobuf.FieldDescriptor();
JOURNEYBUYREQUEST_GOODSINDEX_FIELD = protobuf.FieldDescriptor();
JOURNEYBUYRESPONSE = protobuf.Descriptor(); JOURNEYBUYRESPONSE = protobuf.Descriptor();
JOURNEYBUYRESPONSE_DROP_FIELD = protobuf.FieldDescriptor(); JOURNEYBUYRESPONSE_DROP_FIELD = protobuf.FieldDescriptor();
@ -2321,11 +2322,21 @@ JOURNEYBUYREQUEST_MAPID_FIELD.default_value = 0
JOURNEYBUYREQUEST_MAPID_FIELD.type = 5 JOURNEYBUYREQUEST_MAPID_FIELD.type = 5
JOURNEYBUYREQUEST_MAPID_FIELD.cpp_type = 1 JOURNEYBUYREQUEST_MAPID_FIELD.cpp_type = 1
JOURNEYBUYREQUEST_GOODSINDEX_FIELD.name = "goodsIndex"
JOURNEYBUYREQUEST_GOODSINDEX_FIELD.full_name = ".com.ljsd.jieling.protocols.JourneyBuyRequest.goodsIndex"
JOURNEYBUYREQUEST_GOODSINDEX_FIELD.number = 2
JOURNEYBUYREQUEST_GOODSINDEX_FIELD.index = 1
JOURNEYBUYREQUEST_GOODSINDEX_FIELD.label = 1
JOURNEYBUYREQUEST_GOODSINDEX_FIELD.has_default_value = false
JOURNEYBUYREQUEST_GOODSINDEX_FIELD.default_value = 0
JOURNEYBUYREQUEST_GOODSINDEX_FIELD.type = 5
JOURNEYBUYREQUEST_GOODSINDEX_FIELD.cpp_type = 1
JOURNEYBUYREQUEST.name = "JourneyBuyRequest" JOURNEYBUYREQUEST.name = "JourneyBuyRequest"
JOURNEYBUYREQUEST.full_name = ".com.ljsd.jieling.protocols.JourneyBuyRequest" JOURNEYBUYREQUEST.full_name = ".com.ljsd.jieling.protocols.JourneyBuyRequest"
JOURNEYBUYREQUEST.nested_types = {} JOURNEYBUYREQUEST.nested_types = {}
JOURNEYBUYREQUEST.enum_types = {} JOURNEYBUYREQUEST.enum_types = {}
JOURNEYBUYREQUEST.fields = {JOURNEYBUYREQUEST_MAPID_FIELD} JOURNEYBUYREQUEST.fields = {JOURNEYBUYREQUEST_MAPID_FIELD, JOURNEYBUYREQUEST_GOODSINDEX_FIELD}
JOURNEYBUYREQUEST.is_extendable = false JOURNEYBUYREQUEST.is_extendable = false
JOURNEYBUYREQUEST.extensions = {} JOURNEYBUYREQUEST.extensions = {}
JOURNEYBUYRESPONSE_DROP_FIELD.name = "drop" JOURNEYBUYRESPONSE_DROP_FIELD.name = "drop"

View File

@ -4524,7 +4524,7 @@ function this.StartXiaoyaoBossFightRequest(index,func)
data.monsterIndex = index data.monsterIndex = index
data.mapId = XiaoYaoManager.curMapId data.mapId = XiaoYaoManager.curMapId
local msg = data:SerializeToString() local msg = data:SerializeToString()
Network:SendMessageWithCallBack(MessageTypeProto_pb.JourneyFightRequest, MessageTypeProto_pb.JourneyFightResponse, msg, function(buffer) Network:SendMessageWithCallBack(MessageTypeProto_pb.JOURNEY_FIGHT_REQUEST, MessageTypeProto_pb.JOURNEY_FIGHT_RESPONSE, msg, function(buffer)
local data = buffer:DataByte() local data = buffer:DataByte()
local msg = MapInfoProto_pb.JourneyFightResponse() local msg = MapInfoProto_pb.JourneyFightResponse()
msg:ParseFromString(data) msg:ParseFromString(data)
@ -4537,7 +4537,7 @@ function this.XiaoyaoyouTurnTableRequest(func)
local data = MapInfoProto_pb.JourneyRandomRequest() local data = MapInfoProto_pb.JourneyRandomRequest()
data.mapId = XiaoYaoManager.curMapId data.mapId = XiaoYaoManager.curMapId
local msg = data:SerializeToString() local msg = data:SerializeToString()
Network:SendMessageWithCallBack(MessageTypeProto_pb.JourneyRandomRequest, MessageTypeProto_pb.JourneyRandomResponse, msg, function(buffer) Network:SendMessageWithCallBack(MessageTypeProto_pb.JOURNEY_RANDOM_REQUEST, MessageTypeProto_pb.JOURNEY_RANDOM_RESPONSE, msg, function(buffer)
local data = buffer:DataByte() local data = buffer:DataByte()
local msg = MapInfoProto_pb.JourneyRandomResponse() local msg = MapInfoProto_pb.JourneyRandomResponse()
msg:ParseFromString(data) msg:ParseFromString(data)
@ -4550,7 +4550,7 @@ function this.XiaoyaoyouGetHeroRequest(func)
local data = MapInfoProto_pb.JourneyBuyRequest() local data = MapInfoProto_pb.JourneyBuyRequest()
data.mapId = XiaoYaoManager.curMapId data.mapId = XiaoYaoManager.curMapId
local msg = data:SerializeToString() local msg = data:SerializeToString()
Network:SendMessageWithCallBack(MessageTypeProto_pb.JourneyBuyRequest, MessageTypeProto_pb.JourneyBuyResponse, msg, function(buffer) Network:SendMessageWithCallBack(MessageTypeProto_pb.JOURNEY_BUY_REQUEST, MessageTypeProto_pb.JOURNEY_BUY_RESPONSE, msg, function(buffer)
local data = buffer:DataByte() local data = buffer:DataByte()
local msg = MapInfoProto_pb.JourneyBuyResponse() local msg = MapInfoProto_pb.JourneyBuyResponse()
msg:ParseFromString(data) msg:ParseFromString(data)

View File

@ -10,6 +10,7 @@ local _LiveNode
local heroConfig = ConfigManager.GetConfig(ConfigName.HeroConfig) local heroConfig = ConfigManager.GetConfig(ConfigName.HeroConfig)
local itemConfig=ConfigManager.GetConfig(ConfigName.ItemConfig) local itemConfig=ConfigManager.GetConfig(ConfigName.ItemConfig)
local rewardGroupConfig=ConfigManager.GetConfig(ConfigName.RewardGroup) local rewardGroupConfig=ConfigManager.GetConfig(ConfigName.RewardGroup)
local MonsterGroup=ConfigManager.GetConfig(ConfigName.MonsterGroup)
local MonsterConfig=ConfigManager.GetConfig(ConfigName.MonsterConfig) local MonsterConfig=ConfigManager.GetConfig(ConfigName.MonsterConfig)
local ArtConfig = ConfigManager.GetConfig(ConfigName.ArtResourcesConfig) local ArtConfig = ConfigManager.GetConfig(ConfigName.ArtResourcesConfig)
@ -48,7 +49,9 @@ function XiaoYaoLuckyBossPopup:BindEvent()
if BagManager.GetItemCountById(costId) < costNum then if BagManager.GetItemCountById(costId) < costNum then
PopupTipPanel.ShowTip(itemConfig[costId].Name.."不足") PopupTipPanel.ShowTip(itemConfig[costId].Name.."不足")
else else
XiaoYaoManager.ExecuteFightBattle(curMonsterGroup.monsterIndex) XiaoYaoManager.ExecuteFightBattle(curMonsterGroup.monsterIndex,function()
this:ClosePanel()
end)
end end
end) end)
end end
@ -87,11 +90,11 @@ function XiaoYaoLuckyBossPopup:OnShow()
end end
function this:TimerDown() function this:TimerDown()
if this.Timer then if this.timer then
this.timer:Stop() this.timer:Stop()
this.timer = nil this.timer = nil
end end
local timeDown = curMonsterGroup.remainTime - PlayerManager.serverTime() local timeDown = curMonsterGroup.remainTime - PlayerManager.serverTime
local temp = 0 local temp = 0
this.timeText.text = "剩余时间:"..TimeToHMS(timeDown) this.timeText.text = "剩余时间:"..TimeToHMS(timeDown)
this.timer = Timer.New(function() this.timer = Timer.New(function()
@ -101,7 +104,7 @@ function this:TimerDown()
return return
end end
for i = 1 , #monsterGroup do for i = 1 , #monsterGroup do
temp = monsterGroup[i].remainTime - PlayerManager.serverTime() temp = monsterGroup[i].remainTime - PlayerManager.serverTime
if temp < 1 then if temp < 1 then
this:OnShow() this:OnShow()
return return
@ -130,19 +133,21 @@ function XiaoYaoLuckyBossPopup:SetSingleMonster(go,data)
local icon = Util.GetGameObject(go,"icon"):GetComponent("Image") local icon = Util.GetGameObject(go,"icon"):GetComponent("Image")
local lv = Util.GetGameObject(go,"lv/Text"):GetComponent("Text") local lv = Util.GetGameObject(go,"lv/Text"):GetComponent("Text")
local choosed = Util.GetGameObject(go,"choosed") local choosed = Util.GetGameObject(go,"choosed")
local _data = MonsterConfig[data.monsterId] LogGreen("data.monsterId:"..data.monsterId.." "..MonsterGroup[data.monsterId].Contents[1][2])
frame.sprite = Util.LoadSprite("") local id = MonsterGroup[data.monsterId].Contents[1][2]
local _data = MonsterConfig[id]
frame.sprite = Util.LoadSprite(GetResourcePath(heroConfig[_data.MonsterId].Icon))
icon.sprite = Util.LoadSprite(GetResourcePath(heroConfig[_data.MonsterId].Icon)) icon.sprite = Util.LoadSprite(GetResourcePath(heroConfig[_data.MonsterId].Icon))
lv.text = _data.Level lv.text = _data.Level
if data.monsterIndex == curMonsterGroup.monsterIndex then if data.monsterIndex == curMonsterGroup.monsterIndex then
this.selectKuang:setParent(go.transform) this.selectKuang.transform:SetParent(go.transform)
this.selectKuang:GetComponent("RectTransform").localPosition = Vector3.zero this.selectKuang:GetComponent("RectTransform").localPosition = Vector3.zero
end end
Util.AddOnceClick(go,function() Util.AddOnceClick(go,function()
if curMonsterGroup.monsterId == data.monsterId then if curMonsterGroup.monsterId == data.monsterId then
else else
curMonsterGroup = data curMonsterGroup = data
this.selectKuang:SetParent(go.transform) this.selectKuang.transform:SetParent(go.transform)
this.selectKuang:GetComponent("RectTransform").localPosition = Vector3.zero this.selectKuang:GetComponent("RectTransform").localPosition = Vector3.zero
poolManager:UnLoadLive(_LiveName, _LiveNode) poolManager:UnLoadLive(_LiveName, _LiveNode)
_LiveNode = nil _LiveNode = nil
@ -153,7 +158,7 @@ end
function XiaoYaoLuckyBossPopup:SetSelectHero(monsterData) function XiaoYaoLuckyBossPopup:SetSelectHero(monsterData)
XiaoYaoManager.fightBossIndex = monsterData.monsterIndex XiaoYaoManager.fightBossIndex = monsterData.monsterIndex
local _data = MonsterConfig[monsterData.monsterId] local _data = MonsterConfig[MonsterGroup[monsterData.monsterId].Contents[1][2]]
local monsterId = _data.MonsterId local monsterId = _data.MonsterId
local paintingId = heroConfig[monsterId].Live local paintingId = heroConfig[monsterId].Live
local pos = heroConfig[monsterId].Position local pos = heroConfig[monsterId].Position
@ -162,7 +167,7 @@ function XiaoYaoLuckyBossPopup:SetSelectHero(monsterData)
_LiveNode = poolManager:LoadLive(_LiveName, this.e_liveRoot.transform, Vector3.one * heroConfig[monsterId].Scale*0.7, Vector3.New(pos[1], pos[2], 0)) _LiveNode = poolManager:LoadLive(_LiveName, this.e_liveRoot.transform, Vector3.one * heroConfig[monsterId].Scale*0.7, Vector3.New(pos[1], pos[2], 0))
this.e_level.text = "lv.".. _data.Level this.e_level.text = "lv.".. _data.Level
this.e_name.text = _data.ReadingName this.e_name.text = _data.ReadingName
this.hp.fillAmount = math.floor(monsterData.monsterHp/_data.Hp/100).."%" this.hp.fillAmount = monsterData.monsterHp/_data.Hp
if monsterData.attackNum > 0 then if monsterData.attackNum > 0 then
if not cost[monsterData.attackNum] then if not cost[monsterData.attackNum] then
costId = cost[#cost][1] costId = cost[#cost][1]
@ -171,6 +176,7 @@ function XiaoYaoLuckyBossPopup:SetSelectHero(monsterData)
costId = cost[monsterData.attackNum][1] costId = cost[monsterData.attackNum][1]
costNum = cost[monsterData.attackNum][2] costNum = cost[monsterData.attackNum][2]
end end
LogGreen("costId:"..costId.." costNum:"..costNum)
Util.GetGameObject(this.e_fightBtn,"Text").gameObject:SetActive(false) Util.GetGameObject(this.e_fightBtn,"Text").gameObject:SetActive(false)
Util.GetGameObject(this.e_fightBtn,"layout").gameObject:SetActive(true) Util.GetGameObject(this.e_fightBtn,"layout").gameObject:SetActive(true)
Util.GetGameObject(this.e_fightBtn,"layout/icon"):GetComponent("Image").sprite = Util.LoadSprite(ArtConfig[itemConfig[costId].ResourceID].Name) Util.GetGameObject(this.e_fightBtn,"layout/icon"):GetComponent("Image").sprite = Util.LoadSprite(ArtConfig[itemConfig[costId].ResourceID].Name)
@ -193,7 +199,7 @@ function XiaoYaoLuckyBossPopup:SetSingleReward(id)
local data = rewardGroupConfig[id].ShowItem local data = rewardGroupConfig[id].ShowItem
for i = 1 , #data do for i = 1 , #data do
if not rewardPrefabs[i] then if not rewardPrefabs[i] then
rewardPrefabs[i] = SubUIManager.Open(SubUIConfig.ItemView,this.rewardList) rewardPrefabs[i] = SubUIManager.Open(SubUIConfig.ItemView,this.rewardList.transform)
end end
rewardPrefabs[i].gameObject:SetActive(true) rewardPrefabs[i].gameObject:SetActive(true)
rewardPrefabs[i]:OnOpen(false, {data[i][1],data[i][2]},0.8,false,false,false) rewardPrefabs[i]:OnOpen(false, {data[i][1],data[i][2]},0.8,false,false,false)
@ -203,7 +209,7 @@ function this:OnClose()
poolManager:UnLoadLive(_LiveName, this.e_liveRoot.transform) poolManager:UnLoadLive(_LiveName, this.e_liveRoot.transform)
_LiveName = "" _LiveName = ""
_LiveNode = nil _LiveNode = nil
if this.Timer then if this.timer then
this.timer:Stop() this.timer:Stop()
this.timer = nil this.timer = nil
end end
@ -211,9 +217,11 @@ end
function this:OnDestroy() function this:OnDestroy()
poolManager:UnLoadLive(_LiveName, this.e_liveRoot.transform) poolManager:UnLoadLive(_LiveName, this.e_liveRoot.transform)
monsterGroupPrefabs = nil
rewardPrefabs = nil
_LiveName = "" _LiveName = ""
_LiveNode = nil _LiveNode = nil
if this.Timer then if this.timer then
this.timer:Stop() this.timer:Stop()
this.timer = nil this.timer = nil
end end

View File

@ -149,7 +149,7 @@ function this:TimerDown()
this.timer:Stop() this.timer:Stop()
this.timer = nil this.timer = nil
end end
local timeDown = XiaoYaoManager.luckyluckyTurnTableRemainTime - PlayerManager.serverTime() local timeDown = XiaoYaoManager.luckyluckyTurnTableRemainTime - PlayerManager.serverTime
this.remainTime.text = "剩余时间:"..TimeToHMS(timeDown) this.remainTime.text = "剩余时间:"..TimeToHMS(timeDown)
this.timer = Timer.New(function() this.timer = Timer.New(function()
if timeDown < 1 then if timeDown < 1 then

View File

@ -112,7 +112,7 @@ function this.InitHeroData(goodsInfo,type)
end end
for i = 1 , #this.HeroData do for i = 1 , #this.HeroData do
if this.HeroData[i].remainTime - PlayerManager.serverTime() < 1 then if this.HeroData[i].remainTime - PlayerManager.serverTime < 1 then
if this.HeroData[i].goodsIndex == this.GetHeroIndex then if this.HeroData[i].goodsIndex == this.GetHeroIndex then
this.GetHeroIndex = 0 this.GetHeroIndex = 0
end end
@ -138,6 +138,12 @@ function this.InitMonsterData(BackMonsterDatas,type)
monster.remainTime = BackMonsterDatas[i].remainTime monster.remainTime = BackMonsterDatas[i].remainTime
monster.attackNum = BackMonsterDatas[i].attackNum monster.attackNum = BackMonsterDatas[i].attackNum
monster.reward = BackMonsterDatas[i].rewardShow monster.reward = BackMonsterDatas[i].rewardShow
LogGreen("monster.monsterId"..monster.monsterId)
LogGreen("monster.monsterIndex"..monster.monsterIndex)
LogGreen("monster.monsterHp"..monster.monsterHp)
LogGreen("monster.remainTime"..monster.remainTime)
LogGreen("monster.attackNum"..monster.attackNum)
LogGreen("monster.reward"..monster.reward)
table.insert(this.MonsterData,monster) table.insert(this.MonsterData,monster)
end end
elseif type == 2 then elseif type == 2 then
@ -148,6 +154,14 @@ function this.InitMonsterData(BackMonsterDatas,type)
monster.remainTime = BackMonsterDatas.remainTime monster.remainTime = BackMonsterDatas.remainTime
monster.attackNum = BackMonsterDatas.attackNum monster.attackNum = BackMonsterDatas.attackNum
monster.reward = BackMonsterDatas.rewardShow monster.reward = BackMonsterDatas.rewardShow
LogGreen("monster.monsterId"..monster.monsterId)
LogGreen("monster.monsterIndex"..monster.monsterIndex)
LogGreen("monster.monsterHp"..monster.monsterHp)
LogGreen("monster.remainTime"..monster.remainTime)
LogGreen("monster.attackNum"..monster.attackNum)
--LogGreen("monster.reward"..monster.reward)
LogGreen("monster.reward"..monster.reward)
table.insert(this.MonsterData,monster) table.insert(this.MonsterData,monster)
end end
LogGreen("boss个数"..#this.MonsterData) LogGreen("boss个数"..#this.MonsterData)
@ -170,7 +184,7 @@ function this.InitMonsterData(BackMonsterDatas,type)
return nil return nil
end end
for i = 1 , #this.MonsterData do for i = 1 , #this.MonsterData do
if this.MonsterData[i].remainTime - PlayerManager.serverTime() < 1 then if this.MonsterData[i].remainTime - PlayerManager.serverTime < 1 then
if this.MonsterData[i].monsterIndex == this.fightBossIndex then if this.MonsterData[i].monsterIndex == this.fightBossIndex then
this.fightBossIndex = 0 this.fightBossIndex = 0
end end
@ -199,7 +213,7 @@ function this.GetMonsterDataReMainTimesAndTime()
end end
local removeData = {} local removeData = {}
for i = 1 , #this.MonsterData do for i = 1 , #this.MonsterData do
if this.MonsterData[i].remainTime - PlayerManager.serverTime() < 1 then if this.MonsterData[i].remainTime - PlayerManager.serverTime < 1 then
table.remove(this.MonsterData,i) table.remove(this.MonsterData,i)
end end
end end
@ -208,9 +222,12 @@ function this.GetMonsterDataReMainTimesAndTime()
end end
--开始战斗 --开始战斗
function this.ExecuteFightBattle(id) function this.ExecuteFightBattle(id,func)
NetManager.StartXiaoyaoBossFightRequest(id,function(msg) NetManager.StartXiaoyaoBossFightRequest(id,function(msg)
local fightData = BattleManager.GetBattleServerData(msg,0) local fightData = BattleManager.GetBattleServerData(msg,0)
if func then
func()
end
UIManager.OpenPanel(UIName.BattlePanel, fightData, BATTLE_TYPE.STORY_FIGHT,function(result) UIManager.OpenPanel(UIName.BattlePanel, fightData, BATTLE_TYPE.STORY_FIGHT,function(result)
this.UpdateMonsterData(msg.monster,id) this.UpdateMonsterData(msg.monster,id)
this.OpenMapList() this.OpenMapList()

View File

@ -162,7 +162,7 @@ function this.EventTrigger(_data)
this.bossBtn:SetActive(false) this.bossBtn:SetActive(false)
end end
elseif _data.pathType==6 then --转盘 elseif _data.pathType==6 then --转盘
if XiaoYaoManager.luckyluckyTurnTableRemainTime - PlayerManager.serverTime() > 0 then if XiaoYaoManager.luckyluckyTurnTableRemainTime - PlayerManager.serverTime > 0 then
this.rouleBtn:SetActive(true) this.rouleBtn:SetActive(true)
else else
this.rouleBtn:SetActive(false) this.rouleBtn:SetActive(false)

View File

@ -134,7 +134,7 @@ function this:TimerDown()
this.timer:Stop() this.timer:Stop()
this.timer = nil this.timer = nil
end end
local timeDown = curHeroData.remainTime - PlayerManager.serverTime() local timeDown = curHeroData.remainTime - PlayerManager.serverTime
local temp = 0 local temp = 0
this.remainTimes.text = "剩余时间:"..TimeToHMS(timeDown) this.remainTimes.text = "剩余时间:"..TimeToHMS(timeDown)
this.timer = Timer.New(function() this.timer = Timer.New(function()
@ -144,7 +144,7 @@ function this:TimerDown()
return return
end end
for i = 1 , #heroData do for i = 1 , #heroData do
temp = heroData[i].remainTime - PlayerManager.serverTime() temp = heroData[i].remainTime - PlayerManager.serverTime
if temp < 1 then if temp < 1 then
this:OnShow() this:OnShow()
return return
@ -195,7 +195,7 @@ function this:SetSelectHero(curHeroData)
Util.AddOnceClick(this.talismanBtn.gameObject,function() Util.AddOnceClick(this.talismanBtn.gameObject,function()
UIManager.OpenPanel(UIName.TalismanInfoPopup,heroSData,1,1) UIManager.OpenPanel(UIName.TalismanInfoPopup,heroSData,1,1)
end) end)
this.selectKuang:SetParent(pointPrefabs[curIndex].transform) this.selectKuang.transform:SetParent(pointPrefabs[curIndex].transform)
this.selectKuang:GetComponent("RectTransform").localPosition = Vector3.zero this.selectKuang:GetComponent("RectTransform").localPosition = Vector3.zero
this.ShowHeroBuyInfo(curHeroData) this.ShowHeroBuyInfo(curHeroData)
this:TimerDown() this:TimerDown()