Is "Invoke" just a short version for "yield WaitForSeconds" + FunctionCall?

Found this in the FPS-Tutorial, in the DamageReceiver.js: Is

Invoke ("DelayedDetonate", detonationDelay);

the same as:

yield WaitForSeconds (detonationDelay);
DelayedDetonate ();

? Or am I missing some siginficant detail here?

Thanks & Greetz, Ky.

The two examples you gave would give identical results. However, if you placed a piece of code afterwards, with Invoke it will get executed immediately, whereas with the yield it will be delayed as well.

For example, with this function, someOtherFunction will be called immediately, and DelayedDetonate will be called after detonationDelay seconds.

function Delay() {
    Invoke("DelayedDetonate", detonationDelay);

Whereas with this function, DelayedDetonate will be called after detonationDelay seconds, and someOtherFunction will be called right after DelayedDetonate.

function Delay() {
    yield WaitForSeconds(detonationDelay);

Also, you cannot pass arguments using Invoke.