Merge branch 'dev' of git.juzugame.com:b6-client/b6-lua into dev

This commit is contained in:
chenxi 2023-04-25 23:02:14 +08:00
commit 89bcd8ab01
4 changed files with 65 additions and 16 deletions

View File

@ -147,7 +147,7 @@ function BattleController:onLinkChange()
end
end
self.battleUI:refreshSkill(elementTypeMap, true)
self.battleUI:refreshSkill(elementTypeMap, count > 0)
if mainElementType then
self.atkTeam:changeMainUnit(mainElementType)
end

View File

@ -11,8 +11,8 @@ local BOARD_POS_DOWN = BF.Vector2(0, -740)
local BG_PATH = "assets/arts/textures/background/battle/%s.png"
local CacheVector2 = CS.UnityEngine.Vector2(0, 0)
local CACHE_SKILL_POS_1 = {x = 0, y = 360}
local CACHE_SKILL_POS_2 = {x = 0, y = 420}
local CACHE_SKILL_POS_1 = {x = 10, y = 360}
local CACHE_SKILL_POS_2 = {x = 10, y = 420}
local BATTLE_COMMON_PATH = "assets/arts/textures/background/battle_common/%s.png"
function BattleUI:getPrefabPath()
@ -1036,7 +1036,7 @@ function BattleUI:doCacheAni(skillInfo, callback)
self.cacheSkillAniSeq:AppendCallback(function()
self.boardCacheBox:setAnchoredPositionX(- w)
end)
self.cacheSkillAniSeq:Append(self.boardCacheBox:getTransform():DOAnchorPosX(0, 0.5))
for index, info in ipairs(skillInfo) do
local entity = self.root.skillAniGridEntities[index]
if entity then
@ -1053,8 +1053,24 @@ function BattleUI:doCacheAni(skillInfo, callback)
gridEntity:getCell():getBaseObject():setAnchoredPositionX(DEFAULT_X) -- 放到屏幕外
end
end)
local path = {pos, CACHE_SKILL_POS_2, CACHE_SKILL_POS_1}
self.cacheSkillAniSeq:Insert(0.5 + 0.5 * (index - 1) + 0.02, obj:getTransform():DOLocalPath(path, 1))
self.cacheSkillAniSeq:Insert(0.5 * (index - 1) + 0.02, obj:getTransform():DOAnchorPos(CACHE_SKILL_POS_2, 0.7))
end
end
end
self.cacheSkillAniSeq:Append(self.boardCacheBox:getTransform():DOAnchorPosX(0, 0.5))
for index, info in ipairs(skillInfo) do
local entity = self.root.skillAniGridEntities[index]
if entity then
local cell = entity:getCell()
if cell then
local obj = cell:getBaseObject()
if index == 1 then
self.cacheSkillAniSeq:Append(obj:getTransform():DOAnchorPos(CACHE_SKILL_POS_1, 0.3))
else
self.cacheSkillAniSeq:Join(obj:getTransform():DOAnchorPos(CACHE_SKILL_POS_1, 0.3))
end
end
end
end
@ -1109,21 +1125,37 @@ function BattleUI:doCachePopAni(skillInfo, callback)
obj:setAnchoredPositionX(DEFAULT_X)
end)
self.cacheSkillAniSeq:InsertCallback(0.5 + 0.5 * (index - 1), function()
obj:setAnchoredPosition(0, 360)
obj:setAnchoredPosition(CACHE_SKILL_POS_1.x, CACHE_SKILL_POS_1. y)
end)
local path = {CACHE_SKILL_POS_1, CACHE_SKILL_POS_2, pos}
self.cacheSkillAniSeq:Insert(0.5 + 0.5 * (index - 1) + 0.02, obj:getTransform():DOLocalPath(path, 0.5))
self.cacheSkillAniSeq:InsertCallback(0.5 + 0.5 * (index - 1) + 0.52, function()
if self.battleController then
self.battleController:setGridSkillId(info.posId, info.skillId)
end
end)
self.cacheSkillAniSeq:Insert(0.5 + 0.5 * (index - 1) + 0.02, obj:getTransform():DOAnchorPos(CACHE_SKILL_POS_2, 0.3))
end
end
end
self.cacheSkillAniSeq:Append(self.boardCacheBox:getTransform():DOAnchorPosX(w, 0.5))
for index, info in ipairs(skillInfo) do
local entity = self.root.skillAniGridEntities[index]
if entity then
local pos = ModuleManager.BattleManager:getPosInfo(info.posId)
local cell = entity:getCell()
if cell then
local obj = cell:getBaseObject()
if index == 1 then
self.cacheSkillAniSeq:Append(obj:getTransform():DOAnchorPos(pos, 0.7))
else
self.cacheSkillAniSeq:Join(obj:getTransform():DOAnchorPos(pos, 0.7))
end
end
end
end
self.cacheSkillAniSeq:AppendCallback(function()
for index, info in ipairs(skillInfo) do
if self.battleController then
self.battleController:setGridSkillId(info.posId, info.skillId)
end
end
self.boardCacheNode:setVisible(false)
self:enableUITouch()
if callback then

View File

@ -8,6 +8,12 @@ function SkillNodeCell:refresh(skillEntity, elementMap, showSfx)
end
local uiMap = self:getUIMap()
local mask2 = uiMap["skill_node_cell.icon_node.mask_2"]
if showSfx and add <= 0 then
mask2:setVisible(true)
else
mask2:setVisible(false)
end
local iconNode = uiMap["skill_node_cell.icon_node"]
if not skillEntity:getUnlocked() then
iconNode:setVisible(false)

View File

@ -103,8 +103,19 @@ function MainComp:refreshChapter(force)
local rewardChapterId = DataManager.ChapterData:getIsHaveRewardsMinId()
local curMaxWave = DataManager.ChapterData:getChapterMaxWave(rewardChapterId)
local boxCount = DataManager.ChapterData:getChapterBoxCount(rewardChapterId)
local maxWave = DataManager.ChapterData:getChapterBoxNum(rewardChapterId, boxCount)
slider:getComponent(GConst.TYPEOF_UNITY_CLASS.BF_SLIDER).value = curMaxWave / maxWave
local unitValue = 1 / boxCount
local sliderValue = 0
local lastValue = 0
for i = 1, boxCount do
if curMaxWave < lastValue then
break
end
local maxWave = DataManager.ChapterData:getChapterBoxNum(rewardChapterId, i)
local wave = math.min(curMaxWave, maxWave)
sliderValue = sliderValue + unitValue * (wave - lastValue) / (maxWave - lastValue)
lastValue = maxWave
end
slider:getComponent(GConst.TYPEOF_UNITY_CLASS.BF_SLIDER).value = sliderValue
for index, objs in ipairs(self.boxObjs) do
local show = boxCount >= index