What does `yield return false` do in Unity C # scripts?

As for the duplicate:

I got an answer for this on GameDev.SE. It's pretty clear that this is not a duplicate, although it is now being asked on both sites.

https://gamedev.stackexchange.com/questions/81377/does-yield-return-false-have-special-meaning-in-unity3d-c-scripts


We have this code:

private IEnumerator SomeFunction(/*lots of arguments*/)
{
    // Wait until the local dictionary is loaded
    while (!BundleLibrary.Instance.LocalBundleDictionaryLoaded)
    {
        yield return null;
    }

    //Wait for remote dictionary loaded if needed
    if (BundleConfig.Instance.WaitForRemoteDictionary)
    {
        while (!BundleLibrary.Instance.RemoteBundleDictionaryDownloaded)
        {
            yield return false;
        }
    }
    // more code below here
}

      

I get which yield return null

means the subroutine will pick up where it left off on the next frame.

But I don't quite understand what it does yield return false

. I have not seen this, but I would not know what to do yield return true

.

+3


source to share





All Articles