提交 91e73b65 编写于 作者: D Don McCurdy

Implement manager.resolveResourceURL()

上级 3066eb91
......@@ -19,6 +19,8 @@ Object.assign( FileLoader.prototype, {
if ( this.path !== undefined ) url = this.path + url;
url = this.manager.resolveResourceURL( url );
var scope = this;
var cached = Cache.get( url );
......
......@@ -22,6 +22,8 @@ Object.assign( ImageLoader.prototype, {
if ( this.path !== undefined ) url = this.path + url;
url = this.manager.resolveResourceURL( url );
var scope = this;
var cached = Cache.get( url );
......
......@@ -13,6 +13,8 @@ function LoadingManager( onLoad, onProgress, onError ) {
this.onProgress = onProgress;
this.onError = onError;
this.resourceTransform = undefined;
this.itemStart = function ( url ) {
itemsTotal ++;
......@@ -65,6 +67,24 @@ function LoadingManager( onLoad, onProgress, onError ) {
};
this.resolveResourceURL = function ( url ) {
if ( this.resourceTransform ) {
return this.resourceTransform( url );
}
return url;
};
this.setResourceTransform = function ( transform ) {
this.resourceTransform = transform;
};
}
var DefaultLoadingManager = new LoadingManager();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册