动画调整
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 BG_PATH = "assets/arts/textures/background/battle/%s.png"
|
||||||
local CacheVector2 = CS.UnityEngine.Vector2(0, 0)
|
local CacheVector2 = CS.UnityEngine.Vector2(0, 0)
|
||||||
|
|
||||||
local CACHE_SKILL_POS_1 = {x = 0, y = 360}
|
local CACHE_SKILL_POS_1 = {x = 10, y = 360}
|
||||||
local CACHE_SKILL_POS_2 = {x = 0, y = 420}
|
local CACHE_SKILL_POS_2 = {x = 10, y = 420}
|
||||||
local BATTLE_COMMON_PATH = "assets/arts/textures/background/battle_common/%s.png"
|
local BATTLE_COMMON_PATH = "assets/arts/textures/background/battle_common/%s.png"
|
||||||
|
|
||||||
function BattleUI:getPrefabPath()
|
function BattleUI:getPrefabPath()
|
||||||
@ -1036,7 +1036,7 @@ function BattleUI:doCacheAni(skillInfo, callback)
|
|||||||
self.cacheSkillAniSeq:AppendCallback(function()
|
self.cacheSkillAniSeq:AppendCallback(function()
|
||||||
self.boardCacheBox:setAnchoredPositionX(- w)
|
self.boardCacheBox:setAnchoredPositionX(- w)
|
||||||
end)
|
end)
|
||||||
self.cacheSkillAniSeq:Append(self.boardCacheBox:getTransform():DOAnchorPosX(0, 0.5))
|
|
||||||
for index, info in ipairs(skillInfo) do
|
for index, info in ipairs(skillInfo) do
|
||||||
local entity = self.root.skillAniGridEntities[index]
|
local entity = self.root.skillAniGridEntities[index]
|
||||||
if entity then
|
if entity then
|
||||||
@ -1053,8 +1053,24 @@ function BattleUI:doCacheAni(skillInfo, callback)
|
|||||||
gridEntity:getCell():getBaseObject():setAnchoredPositionX(DEFAULT_X) -- 放到屏幕外
|
gridEntity:getCell():getBaseObject():setAnchoredPositionX(DEFAULT_X) -- 放到屏幕外
|
||||||
end
|
end
|
||||||
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
|
end
|
||||||
end
|
end
|
||||||
@ -1109,21 +1125,37 @@ function BattleUI:doCachePopAni(skillInfo, callback)
|
|||||||
obj:setAnchoredPositionX(DEFAULT_X)
|
obj:setAnchoredPositionX(DEFAULT_X)
|
||||||
end)
|
end)
|
||||||
self.cacheSkillAniSeq:InsertCallback(0.5 + 0.5 * (index - 1), function()
|
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)
|
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():DOAnchorPos(CACHE_SKILL_POS_2, 0.3))
|
||||||
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)
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
self.cacheSkillAniSeq:Append(self.boardCacheBox:getTransform():DOAnchorPosX(w, 0.5))
|
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()
|
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.boardCacheNode:setVisible(false)
|
||||||
self:enableUITouch()
|
self:enableUITouch()
|
||||||
if callback then
|
if callback then
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user