Merge branch 'china/dev-c' of http://60.1.1.230/gaoxin/JL_Client into china/dev-c

dev_chengFeng
ZhangBiao 2021-05-26 21:05:16 +08:00
commit 35acdf34ef
2 changed files with 26 additions and 17 deletions

View File

@ -83,6 +83,11 @@ function this.SingleChapterDataShow(go, data)
npc = PlayerLiveView:New(playerParent.transform,2, PlayerLiveViewData,this.sortingOrder) npc = PlayerLiveView:New(playerParent.transform,2, PlayerLiveViewData,this.sortingOrder)
npc:OnOpen(GetPlayerRoleSingleConFig().Scale6,Vector3.New(0,0,0),WALK_DIR.IDLE_LEFT) npc:OnOpen(GetPlayerRoleSingleConFig().Scale6,Vector3.New(0,0,0),WALK_DIR.IDLE_LEFT)
end end
if curChapterId == data.chapterId then
playerParent.gameObject:SetActive(true)
else
playerParent.gameObject:SetActive(false)
end
cur:SetActive(curChapterId == data.chapterId) cur:SetActive(curChapterId == data.chapterId)
open:SetActive(curChapterId > data.chapterId) open:SetActive(curChapterId > data.chapterId)
lock:SetActive(curChapterId < data.chapterId) lock:SetActive(curChapterId < data.chapterId)

View File

@ -115,15 +115,21 @@ function this.ShowChapterPoint()
table.insert(allNodeDatas,value) table.insert(allNodeDatas,value)
end end
table.sort(allNodeDatas, function(a,b) return a.nodeId < b.nodeId end) table.sort(allNodeDatas, function(a,b) return a.nodeId < b.nodeId end)
local num = 0 local points = {}
for i = 1, #allNodeDatas do for i = 1, #allNodeDatas do
if allNodeDatas[i].config.UselessPoint then if allNodeDatas[i].config.UselessPoint then
local isOpen = this.GetCurLevelIsOpen(allNodeDatas[i])-- -1 未开启 0 开启 1 需解锁上一关 2 等级不足
for j = 1, #allNodeDatas[i].config.UselessPoint do for j = 1, #allNodeDatas[i].config.UselessPoint do
num = num + 1 table.insert(points,{allNodeDatas[i].config.UselessPoint[j][1],allNodeDatas[i].config.UselessPoint[j][2],isOpen})
-- if allNodeDatas[i].config.UselessPoint[j + 1] then
-- local posX = allNodeDatas[i].config.UselessPoint[j][1] + (allNodeDatas[i].config.UselessPoint[j + 1][1] - allNodeDatas[i].config.UselessPoint[j][1])/2
-- local posY = allNodeDatas[i].config.UselessPoint[j][2] + (allNodeDatas[i].config.UselessPoint[j + 1][2] - allNodeDatas[i].config.UselessPoint[j][2])/2
-- table.insert(points,{posX,posY,isOpen})
-- end
end end
end end
end end
for i = 1, math.max(#allSmallPoint , num) do for i = 1, math.max(#allSmallPoint , #points) do
local go = allSmallPoint[i] local go = allSmallPoint[i]
if not go then if not go then
go = newObject(this.pointPre) go = newObject(this.pointPre)
@ -135,18 +141,11 @@ function this.ShowChapterPoint()
end end
go.gameObject:SetActive(false) go.gameObject:SetActive(false)
end end
local index = 0 for i = 1, #points do
for i = 1, #allNodeDatas do allSmallPoint[i].gameObject:SetActive(true)
local isOpen = this.GetCurLevelIsOpen(allNodeDatas[i])-- -1 未开启 0 开启 1 需解锁上一关 2 等级不足 allSmallPoint[i].transform.localPosition = Vector3.New(points[i][1],points[i][2],0)
if allNodeDatas[i].config.UselessPoint then local image = allSmallPoint[i]:GetComponent("Image")
for j = 1, #allNodeDatas[i].config.UselessPoint do image.sprite = this.spLoader:LoadSprite(points[i][3] == 0 and point[1] or point[2])
index = index + 1
allSmallPoint[index].gameObject:SetActive(true)
allSmallPoint[index].transform.localPosition = Vector3.New(allNodeDatas[i].config.UselessPoint[j][1],allNodeDatas[i].config.UselessPoint[j][2],0)
local image = allSmallPoint[index]:GetComponent("Image")
image.sprite = this.spLoader:LoadSprite(isOpen == 0 and point[1] or point[2])
end
end
end end
end end
@ -327,25 +326,30 @@ function this.LeftOrRightBtnClickEvent(index)
-- chapterData = FightLevelManager.GetChapterData(chapterId) -- chapterData = FightLevelManager.GetChapterData(chapterId)
local upChapterId = chapterData.chapterId - 1 local upChapterId = chapterData.chapterId - 1
local upChapterData = FightLevelManager.GetChapterData(upChapterId) local upChapterData = FightLevelManager.GetChapterData(upChapterId)
local canLeft = true
if upChapterData and upChapterId <= FightLevelManager.GetCurChapterId() then if upChapterData and upChapterId <= FightLevelManager.GetCurChapterId() then
this.leftBtn:SetActive(true) this.leftBtn:SetActive(true)
else else
canLeft = false
this.leftBtn:SetActive(false) this.leftBtn:SetActive(false)
end end
local downChapterId = chapterData.chapterId + 1 local downChapterId = chapterData.chapterId + 1
local downChapterData = FightLevelManager.GetChapterData(downChapterId) local downChapterData = FightLevelManager.GetChapterData(downChapterId)
local canRight = true
if downChapterData and downChapterId <= FightLevelManager.GetCurChapterId() then if downChapterData and downChapterId <= FightLevelManager.GetCurChapterId() then
this.rightBtn:SetActive(true) this.rightBtn:SetActive(true)
else else
canRight = false
this.rightBtn:SetActive(false) this.rightBtn:SetActive(false)
end end
if index and index == 1 then--左 if index and index == 1 and canLeft then--左
chapterId = upChapterId chapterId = upChapterId
chapterData = upChapterData chapterData = upChapterData
this.OnShowPanel() this.OnShowPanel()
this.LeftOrRightBtnClickEvent() this.LeftOrRightBtnClickEvent()
elseif index and index == 2 then--右 elseif index and index == 2 and canRight then--右
chapterId = downChapterId chapterId = downChapterId
chapterData = downChapterData chapterData = downChapterData
this.OnShowPanel() this.OnShowPanel()