Will SendMessage() wait until the being called function finished?

Hi guys,

function sth()
{
    GameObject.SendMessage("A");
    DoSomeThing();
}

I wonder whether DoSomeThing() will be executed after the whole A() finished, or just executed immediately after A() is called? In other term, will SendMessage() wait until the being called function finished?

Thank you!!

Well, that depends on what kind of function A is. If it’s a coroutine, send message will “return” once the coroutine reaches it’s first yield. If it’s a normal function it will wait for it.