挂机多人开启条件添加

dev_chengFeng
jiaoyangna 2021-04-15 21:05:27 +08:00
parent 3738137554
commit 5f9144f4e5
2 changed files with 19 additions and 14 deletions

View File

@ -1358,6 +1358,7 @@ FUNCTION_OPEN_TYPE = {
HongMengZhen = 86, -- 鸿蒙阵 HongMengZhen = 86, -- 鸿蒙阵
hunyin = 87, -- 魂印 hunyin = 87, -- 魂印
tianshumijuan = 88,--天书秘卷 tianshumijuan = 88,--天书秘卷
guajigongneng = 89,--挂机多人
} }
TaskGetBtnIconDef = { TaskGetBtnIconDef = {

View File

@ -115,20 +115,24 @@ function this:Init()
local tempconfig = ConfigManager.GetConfigData(ConfigName.ChallengeMapConfig,m_curMapId) local tempconfig = ConfigManager.GetConfigData(ConfigName.ChallengeMapConfig,m_curMapId)
if not this.playerViews[0] then if not this.playerViews[0] then
--LogGreen(m_curMapId) --LogGreen(m_curMapId)
local randomNum = math.random(2, 4) if ActTimeCtrlManager.SingleFuncState(FUNCTION_OPEN_TYPE.guajigongneng) then
PlayerManager.GetFightMapPlayerNPCData(randomNum,function(NPCList) iconNum = 9
--LogGreen("NPCList:"..LengthOfTable(NPCList)) local randomNum = math.random(2, 4)
local index = 1 PlayerManager.GetFightMapPlayerNPCData(randomNum,function(NPCList)
for k,v in pairs(NPCList) do --LogGreen("NPCList:"..LengthOfTable(NPCList))
local index1 = math.random(6,12) local index = 1
local index2 = math.random(19,38) for k,v in pairs(NPCList) do
local index3 = math.random(1,2) local index1 = math.random(6,12)
local index4 = math.random(2,19) local index2 = math.random(19,38)
this.playerViews[index] = SubUIManager.Open(SubUIConfig.SingleFightPlayerView,this.mapRoot.transform,this) local index3 = math.random(1,2)
this.playerViews[index]:SetData((index3 == 1 and index1 or index2),index4,false,v) local index4 = math.random(2,19)
index = index + 1 this.playerViews[index] = SubUIManager.Open(SubUIConfig.SingleFightPlayerView,this.mapRoot.transform,this)
end this.playerViews[index]:SetData((index3 == 1 and index1 or index2),index4,false,v)
end) index = index + 1
end
end)
end
iconNum = 4
this.playerViews[0] = SubUIManager.Open(SubUIConfig.SingleFightPlayerView,this.mapRoot.transform,this) this.playerViews[0] = SubUIManager.Open(SubUIConfig.SingleFightPlayerView,this.mapRoot.transform,this)
this.playerViews[0]:SetData(startUV[m_curMapId].u,startUV[m_curMapId].v,true) this.playerViews[0]:SetData(startUV[m_curMapId].u,startUV[m_curMapId].v,true)
end end