Check all asset types if type == null.

According to OpenFL's documentation, `type` is
"The asset type to match, or null to match any type."
This commit is contained in:
Joseph Cloutier
2022-06-06 23:07:03 -04:00
parent 6652a6f7ab
commit c13f02ef9c

View File

@@ -336,6 +336,10 @@ class AssetLibrary
return switch (cast(type, AssetType))
{
case null:
cachedBytes.exists(id) || cachedText.exists(id) || cachedImages.exists(id)
|| cachedAudioBuffers.exists(id) || cachedFonts.exists(id);
case IMAGE:
cachedImages.exists(id);
@@ -345,7 +349,8 @@ class AssetLibrary
case FONT:
cachedFonts.exists(id);
default: cachedBytes.exists(id) || cachedText.exists(id);
default:
cachedBytes.exists(id) || cachedText.exists(id);
}
#end
}