feature/animation_tree #11
| @ -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