ios - SKAction runblock with arguments -


i have been trying implement following functionality in game. run action on sprite node (sprite node parent nil) , action should wait specified time , add node self. not find action adds node parent. thought doing that:

node.runaction(skaction.sequence([skaction.waitforduration(timetowait), skaction.runblock(addtoself(node))])) 

and having method this:

func addtoself(node: skspritenode){     self.addchild(node) } 

if succeed doing this, game performance improve lot. knows there work around?

you on right track. should able use

skaction.runblock({ self.somefunction(param) }) 

see documentation more details.


Comments

Popular posts from this blog

twig - Using Twigbridge in a Laravel 5.1 Package -

firemonkey - How do I make a beep sound in Android using Delphi and the API? -

jdbc - Not able to establish database connection in eclipse -