I just bought your asset. Looks nice so far.
You support coroutines in the class LatentActionNode and provided the sample WaitNode. Unfortunately this code produces memory garbage. It is 9 bytes by Unity Coroutines. Another garbage comes from the new op of the two queues. Just instantiate them earlier. It comes in unhandy when the Garbage Collector runs and causes frame drops on VR/mobile.
Can you make a node with a possibility to delay but without coroutines? Think about async tasks or simple time math in the Update function?
The allocation from the Queue instantiation can certainly be avoided (I will take care of that soon), but as for the allocation caused by the Unity StartCouroutine call, I don’t think that there is much that can be done here unfortunately :/
Regarding making a delay without coroutines, it is possible to an extend, although not as flexible as using coroutines in the same way that LatentActionNodes do. I have attached for you here an example node called “SimpleDelay” (unitypackage), that is created without coroutines, but rather by utilizing “IUpdatable.Update” (an inteface that nodes can implement if need be).
Please let me know if that is something that would work for you. I don’t know whether I add such node officially, but you can definetely keep it as a custom node if it does indeed work for you.
Thanks a lot! That is what I need. We are working on this code so the node only gets an update called when it is active. We plan graphs with many many nodes. I can send you the results when it is done.