PG 149 – Coroutines

Home Forums Books Mastering Unity 2D Game Development PG 149 – Coroutines

This topic contains 0 replies, has 1 voice, and was last updated by  Simon (darkside) Jackson 3 years, 11 months ago.

Viewing 1 post (of 1 total)
  • Author
    Posts
  • #4356

    One daft errata that slipped through the process (or got changed in publication?) was the note on Coroutines on pg 149/150

    Let me be clear Coroutines are NOT threaded (threading is the process where work can be passed to other processors on your computer to free up speed on your main processor. a simple way of putting it).

    Coroutines run on the same process/thread as your game, if your Coroutine runs forever, it will kill your game.

     

    The reason I point this out is that one tip currently states (which is wrong):

    “Coroutines, by default, do not run the same thread as the normal game”

    Where as the next tip correctly states:

    “Coroutines, by default, run on the same thread as the normal game loop”

     

    This is being updated so that BOTH tips state the same thing (the second one). It’s a small but important point to get across (hence why it’s mentioned twice).  Coroutines can be very powerful when used but like so many things, if used wrong, your game will suffer for it.

    Hope this helps.

     

    Simon (Darkside) Jackson
    @SimonDarksideJ

Viewing 1 post (of 1 total)

The forum ‘Mastering Unity 2D Game Development’ is closed to new topics and replies.