烟雾特效
This commit is contained in:
parent
090f5e549d
commit
d5f2c92d8a
@ -1201,8 +1201,8 @@ function BattleController:setGridSkillId(posId, skillId)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function BattleController:generateGridType(gridType)
|
function BattleController:generateGridType(skillTypeParameter)
|
||||||
if not gridType then
|
if not skillTypeParameter then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -1215,8 +1215,11 @@ function BattleController:generateGridType(gridType)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
if count > 0 then
|
if count > 0 then
|
||||||
local entity = list[math.random(1, count)]
|
local minCount = math.min(skillTypeParameter[2]. count)
|
||||||
self.battleData:setGridInfo(entity:getPosId(), {gridType = gridType, elementType = entity:getElementType()})
|
for i = minCount, 1, -1 do
|
||||||
|
local entity = table.remove(list, math.random(1, i))
|
||||||
|
self.battleData:setGridInfo(entity:getPosId(), {gridType = skillTypeParameter[1], elementType = entity:getElementType()})
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@ -56,6 +56,7 @@ function BattleUI:_display()
|
|||||||
self:initTutorialNode()
|
self:initTutorialNode()
|
||||||
self:initUISfxs()
|
self:initUISfxs()
|
||||||
self:initSkillSelectCells()
|
self:initSkillSelectCells()
|
||||||
|
self:hideAllSfxSmoke()
|
||||||
end
|
end
|
||||||
|
|
||||||
function BattleUI:_addListeners()
|
function BattleUI:_addListeners()
|
||||||
@ -727,9 +728,7 @@ function BattleUI:eliminationAni(sequence, callback)
|
|||||||
|
|
||||||
for index, info in ipairs(sequence) do
|
for index, info in ipairs(sequence) do
|
||||||
if not self.posIdMap[info.posId] then
|
if not self.posIdMap[info.posId] then
|
||||||
self:getSfxSmoke(index, function(obj)
|
local pos = ModuleManager.BattleManager:getPosInfo(info.posId)
|
||||||
obj:play()
|
|
||||||
end)
|
|
||||||
self.posIdMap[info.posId] = true
|
self.posIdMap[info.posId] = true
|
||||||
local entity = DataManager.BattleData:getGridEntity(info.posId)
|
local entity = DataManager.BattleData:getGridEntity(info.posId)
|
||||||
|
|
||||||
@ -740,6 +739,12 @@ function BattleUI:eliminationAni(sequence, callback)
|
|||||||
baseObject:setAnchoredPositionX(DEFAULT_X)
|
baseObject:setAnchoredPositionX(DEFAULT_X)
|
||||||
else
|
else
|
||||||
self.eliminationAniSeq:Insert(index * 0.01, baseObject:getTransform():DOScale(1.3, 0.1))
|
self.eliminationAniSeq:Insert(index * 0.01, baseObject:getTransform():DOScale(1.3, 0.1))
|
||||||
|
self.eliminationAniSeq:InsertCallback(index * 0.01 + 0.2, function()
|
||||||
|
self:getSfxSmoke(index, function(obj)
|
||||||
|
obj:setAnchoredPosition(pos.x, pos.y)
|
||||||
|
obj:play()
|
||||||
|
end)
|
||||||
|
end)
|
||||||
self.eliminationAniSeq:Insert(index * 0.01 + 0.2, baseObject:getTransform():DOAnchorPos(self:getElementSkillPos(entity:getElementType()), 0.3))
|
self.eliminationAniSeq:Insert(index * 0.01 + 0.2, baseObject:getTransform():DOAnchorPos(self:getElementSkillPos(entity:getElementType()), 0.3))
|
||||||
self.eliminationAniSeq:Insert(index * 0.01 + 0.2, baseObject:getTransform():DOScale(0.5, 0.3))
|
self.eliminationAniSeq:Insert(index * 0.01 + 0.2, baseObject:getTransform():DOScale(0.5, 0.3))
|
||||||
end
|
end
|
||||||
@ -1244,7 +1249,8 @@ function BattleUI:getSfxSmoke(index, func)
|
|||||||
}
|
}
|
||||||
EffectManager:loadUIEffectAsync(GConst.BattleConst.LINK_SMOKE, self, self.gridNode, 11, function(obj)
|
EffectManager:loadUIEffectAsync(GConst.BattleConst.LINK_SMOKE, self, self.gridNode, 11, function(obj)
|
||||||
self.root.smokeSfxObjs[index].obj = obj
|
self.root.smokeSfxObjs[index].obj = obj
|
||||||
if self.hidingAllSfxLine then
|
obj:setLocalScale(1.5, 1.5, 1.5)
|
||||||
|
if self.hidingAllSfxSmoke then
|
||||||
obj:setActive(false)
|
obj:setActive(false)
|
||||||
else
|
else
|
||||||
if func then
|
if func then
|
||||||
@ -1296,6 +1302,16 @@ function BattleUI:initUISfxs()
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
if self.root.smokeSfxObjs then
|
||||||
|
for index, info in pairs(self.root.smokeSfxObjs) do
|
||||||
|
if info.obj then
|
||||||
|
info.obj:setActive(true)
|
||||||
|
info.obj:getComponent(GConst.TYPEOF_UNITY_CLASS.BF_EFFECT_HELPER):SetSortingOrder(self:getUIOrder(), 11)
|
||||||
|
info.obj:setActive(false)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function BattleUI:showTutorialFinger(posIdList)
|
function BattleUI:showTutorialFinger(posIdList)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user