allow AnimationNode to not have its own animation
This commit is contained in:
parent
77e723c4bb
commit
f790a4dcf8
@ -30,11 +30,13 @@ function animation:chain(children)
|
||||
return self
|
||||
end
|
||||
|
||||
--- @param data {[1]: animationRunner, onEnd?: voidCallback, children?: AnimationNode[]}
|
||||
--- @param data {[1]: animationRunner?, onEnd?: voidCallback, children?: AnimationNode[]}
|
||||
--- @return AnimationNode
|
||||
local function new(data)
|
||||
local t = setmetatable({}, animation)
|
||||
t.run = data[1]
|
||||
t.run = data[1] or function(self)
|
||||
self:finish()
|
||||
end
|
||||
t.onEnd = data.onEnd
|
||||
t.count = 1 -- своя анимация
|
||||
t.children = {}
|
||||
|
||||
@ -115,9 +115,6 @@ function attack:cast(caster, target)
|
||||
if not sprite or not targetSprite then return true end
|
||||
|
||||
AnimationNode {
|
||||
function(node)
|
||||
caster:has(Tree.behaviors.residentsleeper):sleep(0, node)
|
||||
end,
|
||||
onEnd = function() caster:has(Tree.behaviors.spellcaster):endCast() end,
|
||||
children = {
|
||||
AnimationNode {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user