动画调整
This commit is contained in:
parent
e085aad38f
commit
fd70f87d65
@ -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
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user