x


BCE0005: Unknown identifier: 'StartCoroutine'.

Yes, exist things that can be explain, but how this can!? This is my code:

//Js
class Joemerson
{
    static function Falar(numero : int)
    {
        StartCoroutine(Ler(numero));
    }

    private static function Ler(n : int)
    {
                ...
                while(something)
                {
                          yield WaitForEndOfFrame();
                }
        }
}

And then:

BCE0005: Unknown identifier: 'StartCoroutine'.

Anyone help!?

more ▼

asked Mar 09 '11 at 11:14 PM

fireapache gravatar image

fireapache
44 5 5 8

Why the hell do you accept mikes answer and just start a new question when you problem is not solved? -1 http://answers.unity3d.com/questions/45330/static-ienumerator

Mar 10 '11 at 12:00 AM Bunny83
(comments are locked)
10|3000 characters needed characters left

1 answer: sort voted first

You don't need to call StartCoroutine() in js. Just call the function like you normally would, and Unity will internally start it as a coroutine.

static function Falar(numero : int)
{
    Ler(numero);
}

And, StartCoroutine() is an instance method, so you shouldn't call it from a static method even if you are calling it under the table.

more ▼

answered Mar 09 '11 at 11:18 PM

Peter G gravatar image

Peter G
15.1k 16 44 137

I don't think that will work for static functions! He asked that question just a few minutes ago... http://answers.unity3d.com/questions/45330/static-ienumerator

Mar 09 '11 at 11:48 PM Bunny83

I had noticed that, but then I stated that below my code so that no one could see it. :) Oh well.

Mar 10 '11 at 12:19 AM Peter G
(comments are locked)
10|3000 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Topics:

x348
x72

asked: Mar 09 '11 at 11:14 PM

Seen: 1399 times

Last Updated: Mar 09 '11 at 11:14 PM