Comments on: Custom Coroutineshttps://blogs.unity3d.com/2015/12/01/custom-coroutines/
A glimpse inside Unity Technologies...Thu, 22 Feb 2018 05:21:55 +0000hourly1https://wordpress.org/?v=4.9.4By: Karl Joneshttps://blogs.unity3d.com/2015/12/01/custom-coroutines/#comment-280525
Fri, 15 Jan 2016 10:20:53 +0000http://blogs.unity3d.com/?p=31981#comment-280525Yeah I didn’t realise we had support for code snippets in our blogs. I now know better :)
]]>By: Marko Ravnjakhttps://blogs.unity3d.com/2015/12/01/custom-coroutines/#comment-280499
Fri, 15 Jan 2016 10:08:19 +0000http://blogs.unity3d.com/?p=31981#comment-280499Is it just me or are code snippets as images really un-useful?
]]>By: Kristianihttps://blogs.unity3d.com/2015/12/01/custom-coroutines/#comment-242023
Sun, 20 Dec 2015 22:38:45 +0000http://blogs.unity3d.com/?p=31981#comment-242023Yup. My only point here really is that they are motsly equivalent.Holy cow though I find CPS code to be impossible to read and impossible to debug.We’re getting more and more of it in the world and good god is it ugly.Callbacks are a nasty nasty way to write code.
]]>By: Cintiahttps://blogs.unity3d.com/2015/12/01/custom-coroutines/#comment-241993
Sun, 20 Dec 2015 21:57:14 +0000http://blogs.unity3d.com/?p=31981#comment-241993With the bases loaded you struck us out with that anwsre!
]]>By: Sajidhttps://blogs.unity3d.com/2015/12/01/custom-coroutines/#comment-241984
Sun, 20 Dec 2015 21:52:44 +0000http://blogs.unity3d.com/?p=31981#comment-241984whydoidoit November 28, 2012 – 10:15 pm That happens when yiendilg in a coroutine the compiler has generated code that MonoDevelop cannot break on it does cause the debugger to appear to step to exit code don’t worry about it, it’s just the magic class doing its return.
]]>By: Takuohttps://blogs.unity3d.com/2015/12/01/custom-coroutines/#comment-241978
Sun, 20 Dec 2015 21:48:53 +0000http://blogs.unity3d.com/?p=31981#comment-241978Your thkining matches mine – great minds think alike!
]]>By: Moshtaqhttps://blogs.unity3d.com/2015/12/01/custom-coroutines/#comment-241972
Sun, 20 Dec 2015 21:45:55 +0000http://blogs.unity3d.com/?p=31981#comment-241972That’s a sensible answer to a chnalengilg question
]]>By: Sherylhttps://blogs.unity3d.com/2015/12/01/custom-coroutines/#comment-241960
Sun, 20 Dec 2015 21:29:59 +0000http://blogs.unity3d.com/?p=31981#comment-241960I’m really sorry to ask for coriifacatiln on this I wrote an algorithm that creates an rtf javascript editor in a web page. The editor works flawlessly when the javascript file unminified is < 1000 lines. The work around I found for parsing large scripts was to setinterval and time my execution. If it took too long I'd set an interval to release the thread and reenter such that the browser wouldn't display the unresponsive script error.Are you saying this threading code will unlock the HTML ui layer and allow background processing to occur? If what you say is true, and the previous comment about ie supporting a variant of this is true, you could have just rocked my world let me know.M
]]>By: Montasirhttps://blogs.unity3d.com/2015/12/01/custom-coroutines/#comment-241957
Sun, 20 Dec 2015 21:24:20 +0000http://blogs.unity3d.com/?p=31981#comment-241957mick November 28, 2012 – 9:57 pm Question about stepping torhugh DoHijack() with the monodevelop debugger:50IEnumerator DoHijack()51{52while(true)53{54//Check if we have a current coroutine and MoveNext on it if we do55if(_current != null && _current.MoveNext())56{57//Return whatever the coroutine yielded, so we will yield the58//same thing59yield return _current.Current;60}61else62//Otherwise wait for the next frame63yield return null;64}65}When I break on line 59 and then step over (f10), the current instruction caret moves to line 63 even though it doesn’t appear to be executing that line (ie if I set a breakpoint on line 63 it wont’ get hit). What is going on here?
]]>By: Custom Coroutines | TRIFORCE STUDIOhttps://blogs.unity3d.com/2015/12/01/custom-coroutines/#comment-240224
Thu, 17 Dec 2015 01:31:47 +0000http://blogs.unity3d.com/?p=31981#comment-240224[…] Read more […]
]]>By: gl33merhttps://blogs.unity3d.com/2015/12/01/custom-coroutines/#comment-239257
Wed, 09 Dec 2015 14:37:47 +0000http://blogs.unity3d.com/?p=31981#comment-239257Oh, I see what you mean. If they implemented WaitForSecondsRealtime may as well implement WaitForSecondsUnscaledTime in the API.

I still get confused by Coroutines without the custom yield. :-)

]]>By: Karl Joneshttps://blogs.unity3d.com/2015/12/01/custom-coroutines/#comment-239215
Wed, 09 Dec 2015 10:57:47 +0000http://blogs.unity3d.com/?p=31981#comment-239215The ability to do this has existed for some time now but not many users were aware so its a way of making it more obvious. I also believe we have made some improvements to how Unity handles IEnumerator when yielding.
]]>By: Johnhttps://blogs.unity3d.com/2015/12/01/custom-coroutines/#comment-239102
Wed, 09 Dec 2015 00:05:41 +0000http://blogs.unity3d.com/?p=31981#comment-239102Thanks for the post, Karl!

But from what you wrote, I was really worried that CustomYieldInstruction was too limited an API, especially for basic cases where you want to reuse a yield instruction instance to prevent too much GC pressure from high-frequency or persistent waits.

I’m SUPER happy to know, from reading the new documentation, that you can also implement custom yield instructions by just implementing IEnumerator in any arbitrary class.

But then I wondered, was this always the case even before 5.3?
If so, I feel so stupid for not doing it that way before. At the same time though, nobody else seemed to catch on and post about it online in Unity tips blogs so was there something else to that?

]]>By: gl33merhttps://blogs.unity3d.com/2015/12/01/custom-coroutines/#comment-238864
Tue, 08 Dec 2015 05:08:26 +0000http://blogs.unity3d.com/?p=31981#comment-238864“the new WaitForSecondsRealtime” is actually not a new built-in Unity feature but rather an example of how one would build a class inheriting from the new CustomYieldInstruction class (which is a new built-in Unity feature).
]]>By: Bastehttps://blogs.unity3d.com/2015/12/01/custom-coroutines/#comment-238831
Mon, 07 Dec 2015 15:38:09 +0000http://blogs.unity3d.com/?p=31981#comment-238831Also, it’d be really nice if we could edit posts we make here, in case we mess up the formatting :D
]]>