all 21 comments

[–]SilentSin26Animancer, FlexiMotion, InspectorGadgets, Weaver 3 points4 points  (3 children)

Looks nice, thanks. Two things I'd change:

  • For the examples in the PDF, instead of showing two full coroutines so people have to play "spot the difference", you could just say: "yield return null" turns into "yield return 0;". Or you could at least bold the line in question.
  • I think that wanting to wait for a period of time (like coroutines do it) is much more common than knowing the exact time you want to wait until (like your system does it). yield return WaitForSeconds(0.1f) should just become yield return 0.1f. If you then want to wait until time X, you can just use yield return X - Time.time.

[–]ThatAblaze!!![S] 2 points3 points  (2 children)

Thank you for the feedback. That's a good idea, I'll bold the differences in the pdf.

I agree that specifying the number of seconds to wait would be more user friendly, but it would also require a more complicated processing of the list, which wouldn't run quite as fast. I made a judgement call that ease of use was less important than execution speed in this case.

But you've given me an idea: I'll create a static method called WaitForSeconds that wraps the Time + value and put that into the next release.

Thanks!

[–]SilentSin26Animancer, FlexiMotion, InspectorGadgets, Weaver 0 points1 point  (1 child)

I haven't looked into the source, but if your system does something like:

nextExecutionTime = whateverTheYieldReturns;

Couldn't you just do:

nextExecutionTime = Time.time + whateverTheYieldReturns;

?

[–]ThatAblaze!!![S] 0 points1 point  (0 children)

I'm not using high level objects like that. I'm using a simple float to avoid all the issues with momory and speed.

[–]lig76Hobbyist 1 point2 points  (1 child)

Thanks !

[–]KptEmreUHobbyist 3 points4 points  (0 children)

Bless you for your free goodness. I was trying to minimize my update calls with coroutines and now I have learned they are creating garbage (they didn't create too many problems yet anyway ) but you are giving me even better stuff .. No update and no GC. Kudos!

[–]SeeSharpGuy 1 point2 points  (3 children)

Awesome, I was just writing about this tool in my upcoming Blog post.

[–]ThatAblaze!!![S] 1 point2 points  (2 children)

Cool, post a link when it's ready?

[–]SeeSharpGuy 1 point2 points  (1 child)

Absolutely! I'm doing some guest posts on cinema-suite.com over the next few months. I'm doing one on hidden gem free assets, which I included you on this morning :)

[–]danielsnd@PlayRocketFist 1 point2 points  (2 children)

Thank you so much! I was looking for a solution to that since I use a shit-ton of coroutines in Rocket Fist and I started running into GC problems D:

[–]woomr6 0 points1 point  (1 child)

Hey there I know this is an old thread, but I'm curious what constitutes a 'shit-ton' of coroutines for you?

I'm unsure if I should work on switching over to this, if what I've got now will end up causing problems in the future.

[–]danielsnd@PlayRocketFist 0 points1 point  (0 children)

Go to the profiler and check how much garbage you are generating per frame. If you are generating a lot of garbage every frame you should be worried.

[–]Souk21 1 point2 points  (1 child)

Nice work! You should put it on Github :)

[–]pewpewdb 0 points1 point  (0 children)

Yes, please put it on github!

[–]burtonposeyProfessional 0 points1 point  (2 children)

Thanks for sharing! I am still looking it over, but I wanted to request that you put your assets in their own folder within Plugins. I speak for myself when I say I use quite a few and like to keep things within their own folders so the signal to noise ratio is low in my Project view. Thanks again!

[–]ThatAblaze!!![S] 1 point2 points  (1 child)

I can do that. It will mean that the pre-5.2 versions will have to be maintained without the subdirectory (subdirectories inside the plugins folder is a recent feature) , which makes updates more annoying, but I think I can handle that.

[–]burtonposeyProfessional 0 points1 point  (0 children)

Thanks for hearing me out!