修改提交
parent
c8a9f3f8db
commit
598ca9e91f
|
|
@ -533,7 +533,7 @@ Canvas:
|
|||
m_PlaneDistance: 100
|
||||
m_PixelPerfect: 0
|
||||
m_ReceivesEvents: 1
|
||||
m_OverrideSorting: 0
|
||||
m_OverrideSorting: 1
|
||||
m_OverridePixelPerfect: 0
|
||||
m_SortingBucketNormalizedSize: 0
|
||||
m_AdditionalShaderChannelsFlag: 0
|
||||
|
|
|
|||
|
|
@ -227,6 +227,7 @@ JOURNEYRANDOMRESPONSE_NEXTRANDOM_FIELD = protobuf.FieldDescriptor();
|
|||
JOURNEYRANDOMRESPONSE_COUNT_FIELD = protobuf.FieldDescriptor();
|
||||
JOURNEYBUYREQUEST = protobuf.Descriptor();
|
||||
JOURNEYBUYREQUEST_MAPID_FIELD = protobuf.FieldDescriptor();
|
||||
JOURNEYBUYREQUEST_GOODSINDEX_FIELD = protobuf.FieldDescriptor();
|
||||
JOURNEYBUYRESPONSE = protobuf.Descriptor();
|
||||
JOURNEYBUYRESPONSE_DROP_FIELD = protobuf.FieldDescriptor();
|
||||
|
||||
|
|
@ -2321,11 +2322,21 @@ JOURNEYBUYREQUEST_MAPID_FIELD.default_value = 0
|
|||
JOURNEYBUYREQUEST_MAPID_FIELD.type = 5
|
||||
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.full_name = ".com.ljsd.jieling.protocols.JourneyBuyRequest"
|
||||
JOURNEYBUYREQUEST.nested_types = {}
|
||||
JOURNEYBUYREQUEST.enum_types = {}
|
||||
JOURNEYBUYREQUEST.fields = {JOURNEYBUYREQUEST_MAPID_FIELD}
|
||||
JOURNEYBUYREQUEST.fields = {JOURNEYBUYREQUEST_MAPID_FIELD, JOURNEYBUYREQUEST_GOODSINDEX_FIELD}
|
||||
JOURNEYBUYREQUEST.is_extendable = false
|
||||
JOURNEYBUYREQUEST.extensions = {}
|
||||
JOURNEYBUYRESPONSE_DROP_FIELD.name = "drop"
|
||||
|
|
|
|||
|
|
@ -4524,7 +4524,7 @@ function this.StartXiaoyaoBossFightRequest(index,func)
|
|||
data.monsterIndex = index
|
||||
data.mapId = XiaoYaoManager.curMapId
|
||||
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 msg = MapInfoProto_pb.JourneyFightResponse()
|
||||
msg:ParseFromString(data)
|
||||
|
|
@ -4537,7 +4537,7 @@ function this.XiaoyaoyouTurnTableRequest(func)
|
|||
local data = MapInfoProto_pb.JourneyRandomRequest()
|
||||
data.mapId = XiaoYaoManager.curMapId
|
||||
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 msg = MapInfoProto_pb.JourneyRandomResponse()
|
||||
msg:ParseFromString(data)
|
||||
|
|
@ -4550,7 +4550,7 @@ function this.XiaoyaoyouGetHeroRequest(func)
|
|||
local data = MapInfoProto_pb.JourneyBuyRequest()
|
||||
data.mapId = XiaoYaoManager.curMapId
|
||||
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 msg = MapInfoProto_pb.JourneyBuyResponse()
|
||||
msg:ParseFromString(data)
|
||||
|
|
|
|||
|
|
@ -10,6 +10,7 @@ local _LiveNode
|
|||
local heroConfig = ConfigManager.GetConfig(ConfigName.HeroConfig)
|
||||
local itemConfig=ConfigManager.GetConfig(ConfigName.ItemConfig)
|
||||
local rewardGroupConfig=ConfigManager.GetConfig(ConfigName.RewardGroup)
|
||||
local MonsterGroup=ConfigManager.GetConfig(ConfigName.MonsterGroup)
|
||||
local MonsterConfig=ConfigManager.GetConfig(ConfigName.MonsterConfig)
|
||||
local ArtConfig = ConfigManager.GetConfig(ConfigName.ArtResourcesConfig)
|
||||
|
||||
|
|
@ -48,7 +49,9 @@ function XiaoYaoLuckyBossPopup:BindEvent()
|
|||
if BagManager.GetItemCountById(costId) < costNum then
|
||||
PopupTipPanel.ShowTip(itemConfig[costId].Name.."不足")
|
||||
else
|
||||
XiaoYaoManager.ExecuteFightBattle(curMonsterGroup.monsterIndex)
|
||||
XiaoYaoManager.ExecuteFightBattle(curMonsterGroup.monsterIndex,function()
|
||||
this:ClosePanel()
|
||||
end)
|
||||
end
|
||||
end)
|
||||
end
|
||||
|
|
@ -87,11 +90,11 @@ function XiaoYaoLuckyBossPopup:OnShow()
|
|||
end
|
||||
|
||||
function this:TimerDown()
|
||||
if this.Timer then
|
||||
if this.timer then
|
||||
this.timer:Stop()
|
||||
this.timer = nil
|
||||
end
|
||||
local timeDown = curMonsterGroup.remainTime - PlayerManager.serverTime()
|
||||
local timeDown = curMonsterGroup.remainTime - PlayerManager.serverTime
|
||||
local temp = 0
|
||||
this.timeText.text = "剩余时间:"..TimeToHMS(timeDown)
|
||||
this.timer = Timer.New(function()
|
||||
|
|
@ -101,7 +104,7 @@ function this:TimerDown()
|
|||
return
|
||||
end
|
||||
for i = 1 , #monsterGroup do
|
||||
temp = monsterGroup[i].remainTime - PlayerManager.serverTime()
|
||||
temp = monsterGroup[i].remainTime - PlayerManager.serverTime
|
||||
if temp < 1 then
|
||||
this:OnShow()
|
||||
return
|
||||
|
|
@ -130,19 +133,21 @@ function XiaoYaoLuckyBossPopup:SetSingleMonster(go,data)
|
|||
local icon = Util.GetGameObject(go,"icon"):GetComponent("Image")
|
||||
local lv = Util.GetGameObject(go,"lv/Text"):GetComponent("Text")
|
||||
local choosed = Util.GetGameObject(go,"choosed")
|
||||
local _data = MonsterConfig[data.monsterId]
|
||||
frame.sprite = Util.LoadSprite("")
|
||||
LogGreen("data.monsterId:"..data.monsterId.." "..MonsterGroup[data.monsterId].Contents[1][2])
|
||||
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))
|
||||
lv.text = _data.Level
|
||||
if data.monsterIndex == curMonsterGroup.monsterIndex then
|
||||
this.selectKuang:setParent(go.transform)
|
||||
this.selectKuang.transform:SetParent(go.transform)
|
||||
this.selectKuang:GetComponent("RectTransform").localPosition = Vector3.zero
|
||||
end
|
||||
Util.AddOnceClick(go,function()
|
||||
if curMonsterGroup.monsterId == data.monsterId then
|
||||
else
|
||||
curMonsterGroup = data
|
||||
this.selectKuang:SetParent(go.transform)
|
||||
this.selectKuang.transform:SetParent(go.transform)
|
||||
this.selectKuang:GetComponent("RectTransform").localPosition = Vector3.zero
|
||||
poolManager:UnLoadLive(_LiveName, _LiveNode)
|
||||
_LiveNode = nil
|
||||
|
|
@ -153,7 +158,7 @@ end
|
|||
|
||||
function XiaoYaoLuckyBossPopup:SetSelectHero(monsterData)
|
||||
XiaoYaoManager.fightBossIndex = monsterData.monsterIndex
|
||||
local _data = MonsterConfig[monsterData.monsterId]
|
||||
local _data = MonsterConfig[MonsterGroup[monsterData.monsterId].Contents[1][2]]
|
||||
local monsterId = _data.MonsterId
|
||||
local paintingId = heroConfig[monsterId].Live
|
||||
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))
|
||||
this.e_level.text = "lv.".. _data.Level
|
||||
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 not cost[monsterData.attackNum] then
|
||||
costId = cost[#cost][1]
|
||||
|
|
@ -171,6 +176,7 @@ function XiaoYaoLuckyBossPopup:SetSelectHero(monsterData)
|
|||
costId = cost[monsterData.attackNum][1]
|
||||
costNum = cost[monsterData.attackNum][2]
|
||||
end
|
||||
LogGreen("costId:"..costId.." costNum:"..costNum)
|
||||
Util.GetGameObject(this.e_fightBtn,"Text").gameObject:SetActive(false)
|
||||
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)
|
||||
|
|
@ -193,7 +199,7 @@ function XiaoYaoLuckyBossPopup:SetSingleReward(id)
|
|||
local data = rewardGroupConfig[id].ShowItem
|
||||
for i = 1 , #data do
|
||||
if not rewardPrefabs[i] then
|
||||
rewardPrefabs[i] = SubUIManager.Open(SubUIConfig.ItemView,this.rewardList)
|
||||
rewardPrefabs[i] = SubUIManager.Open(SubUIConfig.ItemView,this.rewardList.transform)
|
||||
end
|
||||
rewardPrefabs[i].gameObject:SetActive(true)
|
||||
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)
|
||||
_LiveName = ""
|
||||
_LiveNode = nil
|
||||
if this.Timer then
|
||||
if this.timer then
|
||||
this.timer:Stop()
|
||||
this.timer = nil
|
||||
end
|
||||
|
|
@ -211,9 +217,11 @@ end
|
|||
|
||||
function this:OnDestroy()
|
||||
poolManager:UnLoadLive(_LiveName, this.e_liveRoot.transform)
|
||||
monsterGroupPrefabs = nil
|
||||
rewardPrefabs = nil
|
||||
_LiveName = ""
|
||||
_LiveNode = nil
|
||||
if this.Timer then
|
||||
if this.timer then
|
||||
this.timer:Stop()
|
||||
this.timer = nil
|
||||
end
|
||||
|
|
|
|||
|
|
@ -149,7 +149,7 @@ function this:TimerDown()
|
|||
this.timer:Stop()
|
||||
this.timer = nil
|
||||
end
|
||||
local timeDown = XiaoYaoManager.luckyluckyTurnTableRemainTime - PlayerManager.serverTime()
|
||||
local timeDown = XiaoYaoManager.luckyluckyTurnTableRemainTime - PlayerManager.serverTime
|
||||
this.remainTime.text = "剩余时间:"..TimeToHMS(timeDown)
|
||||
this.timer = Timer.New(function()
|
||||
if timeDown < 1 then
|
||||
|
|
|
|||
|
|
@ -112,7 +112,7 @@ function this.InitHeroData(goodsInfo,type)
|
|||
end
|
||||
|
||||
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
|
||||
this.GetHeroIndex = 0
|
||||
end
|
||||
|
|
@ -138,6 +138,12 @@ function this.InitMonsterData(BackMonsterDatas,type)
|
|||
monster.remainTime = BackMonsterDatas[i].remainTime
|
||||
monster.attackNum = BackMonsterDatas[i].attackNum
|
||||
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)
|
||||
end
|
||||
elseif type == 2 then
|
||||
|
|
@ -148,6 +154,14 @@ function this.InitMonsterData(BackMonsterDatas,type)
|
|||
monster.remainTime = BackMonsterDatas.remainTime
|
||||
monster.attackNum = BackMonsterDatas.attackNum
|
||||
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)
|
||||
end
|
||||
LogGreen("boss个数"..#this.MonsterData)
|
||||
|
|
@ -170,7 +184,7 @@ function this.InitMonsterData(BackMonsterDatas,type)
|
|||
return nil
|
||||
end
|
||||
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
|
||||
this.fightBossIndex = 0
|
||||
end
|
||||
|
|
@ -199,7 +213,7 @@ function this.GetMonsterDataReMainTimesAndTime()
|
|||
end
|
||||
local removeData = {}
|
||||
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)
|
||||
end
|
||||
end
|
||||
|
|
@ -208,9 +222,12 @@ function this.GetMonsterDataReMainTimesAndTime()
|
|||
end
|
||||
|
||||
--开始战斗
|
||||
function this.ExecuteFightBattle(id)
|
||||
function this.ExecuteFightBattle(id,func)
|
||||
NetManager.StartXiaoyaoBossFightRequest(id,function(msg)
|
||||
local fightData = BattleManager.GetBattleServerData(msg,0)
|
||||
if func then
|
||||
func()
|
||||
end
|
||||
UIManager.OpenPanel(UIName.BattlePanel, fightData, BATTLE_TYPE.STORY_FIGHT,function(result)
|
||||
this.UpdateMonsterData(msg.monster,id)
|
||||
this.OpenMapList()
|
||||
|
|
|
|||
|
|
@ -162,7 +162,7 @@ function this.EventTrigger(_data)
|
|||
this.bossBtn:SetActive(false)
|
||||
end
|
||||
elseif _data.pathType==6 then --转盘
|
||||
if XiaoYaoManager.luckyluckyTurnTableRemainTime - PlayerManager.serverTime() > 0 then
|
||||
if XiaoYaoManager.luckyluckyTurnTableRemainTime - PlayerManager.serverTime > 0 then
|
||||
this.rouleBtn:SetActive(true)
|
||||
else
|
||||
this.rouleBtn:SetActive(false)
|
||||
|
|
|
|||
|
|
@ -134,7 +134,7 @@ function this:TimerDown()
|
|||
this.timer:Stop()
|
||||
this.timer = nil
|
||||
end
|
||||
local timeDown = curHeroData.remainTime - PlayerManager.serverTime()
|
||||
local timeDown = curHeroData.remainTime - PlayerManager.serverTime
|
||||
local temp = 0
|
||||
this.remainTimes.text = "剩余时间:"..TimeToHMS(timeDown)
|
||||
this.timer = Timer.New(function()
|
||||
|
|
@ -144,7 +144,7 @@ function this:TimerDown()
|
|||
return
|
||||
end
|
||||
for i = 1 , #heroData do
|
||||
temp = heroData[i].remainTime - PlayerManager.serverTime()
|
||||
temp = heroData[i].remainTime - PlayerManager.serverTime
|
||||
if temp < 1 then
|
||||
this:OnShow()
|
||||
return
|
||||
|
|
@ -195,7 +195,7 @@ function this:SetSelectHero(curHeroData)
|
|||
Util.AddOnceClick(this.talismanBtn.gameObject,function()
|
||||
UIManager.OpenPanel(UIName.TalismanInfoPopup,heroSData,1,1)
|
||||
end)
|
||||
this.selectKuang:SetParent(pointPrefabs[curIndex].transform)
|
||||
this.selectKuang.transform:SetParent(pointPrefabs[curIndex].transform)
|
||||
this.selectKuang:GetComponent("RectTransform").localPosition = Vector3.zero
|
||||
this.ShowHeroBuyInfo(curHeroData)
|
||||
this:TimerDown()
|
||||
|
|
|
|||
Loading…
Reference in New Issue