|
|
|
|
|
by kayoone
4822 days ago
|
|
Why would you ever yield return a single value? Thats a special case in the Unity game engine as the Update() functions of each script are called in the Game loop once per frame. Now if you do a WWW Request without yielding out of the game loop, the game will hang in that frame until the WWW Request is finished. By yielding it does the WWW Request asynchronous outside of the game loop and comes back to the Debug statement when the WWW Request is done. I share your view on the incosistent Code Style though, it should be PascalCase all the way and i have always done it like that in Unity projects. Public fields are another thing special to Unity, as you are able to modify public fields directly within the IDEs Object Inspector, which allows you to modify values while testing the game for example. You can also use Properties but those wont allow you said Inspector modifications (at least in Version 3.x that was the case). |
|