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

powershell Start-Process exit code -1073741502 when used with Credential from a windows service environment -

twig - Using Twigbridge in a Laravel 5.1 Package -

c# - LINQ join Entities from HashSet's, Join vs Dictionary vs HashSet performance -