|
I'm almost convinced I'm seeing a bug, but this is an entirely new concept for me, so I need some help to understand what's going on. Here's a somewhat simplified version:
What's weird is I never see "Enter Loop()" in the console (or anything from DoLoop()), but I see the "Initialize 1", 2, and 3. If I comment out the while (true) loop, I'll see both the "Enter Loop()" and "Exit Loop()", but otherwise neither. What's going on?
(comments are locked)
|
|
When a coroutine is called, it does not automatically run through to completion. It returns the body of the routine embedded in an object implementing the When writing scripts in C#, this is explicit. You have to start a corutine with In Javascript, I believe the compiler determines which routines are coroutines, and automatically calls StartCoroutine automatically, however apparently not from static routines. TLDR; do as Eric suggested, remove both instances of static. Re the scripting language name, it is consistently referred to as Javascript in the Unity manual and in other official written Unity materials.
Apr 06 '10 at 09:37 AM
runevision ♦♦
@Rune ok. thx :)
Apr 06 '10 at 11:14 AM
KvanteTore
Javascript automatically uses StartCoroutine from anywhere, not just Update etc.
Apr 06 '10 at 05:03 PM
Eric5h5
@Eric5h5. Ok, that's kind of neat and kind of scary... updated the last statement to reflect this.
Apr 06 '10 at 11:11 PM
KvanteTore
(comments are locked)
|
|
Remove both instances of "static".
(comments are locked)
|
