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.
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
No one has answered this question yet
See similar questions:
or similar: