Improve DefaultAssetLibrary.isLocal
This commit is contained in:
@@ -412,16 +412,33 @@ class DefaultAssetLibrary extends AssetLibrary {
|
|||||||
|
|
||||||
public override function isLocal (id:String, type:String):Bool {
|
public override function isLocal (id:String, type:String):Bool {
|
||||||
|
|
||||||
#if (flash || windows || mac || linux)
|
#if flash
|
||||||
|
|
||||||
return className.exists (id);
|
return className.exists (id);
|
||||||
|
|
||||||
|
#elseif html5
|
||||||
|
|
||||||
|
var requestedType = type != null ? cast (type, AssetType) : null;
|
||||||
|
|
||||||
|
return switch (requestedType) {
|
||||||
|
|
||||||
|
case FONT:
|
||||||
|
|
||||||
|
className.exists (id);
|
||||||
|
|
||||||
|
case IMAGE:
|
||||||
|
|
||||||
|
Preloader.images.exists (path.get (id));
|
||||||
|
|
||||||
|
default:
|
||||||
|
|
||||||
|
Preloader.loaders.exists (path.get (id));
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
#else
|
#else
|
||||||
var requestedType = type != null ? cast (type, AssetType) : null;
|
|
||||||
if (requestedType == AssetType.FONT)
|
return true;
|
||||||
return className.exists (id);
|
|
||||||
else
|
|
||||||
return path.exists (id);
|
|
||||||
|
|
||||||
#end
|
#end
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user