| 1234567891011121314151617181920212223242526272829303132333435363738394041 |
- /**
- * @author mrdoob / http://mrdoob.com/
- */
- THREE.LoadingManager = function ( onLoad, onProgress, onError ) {
- var scope = this;
- var loaded = 0, total = 0;
- this.onLoad = onLoad;
- this.onProgress = onProgress;
- this.onError = onError;
- this.itemStart = function ( url ) {
- total ++;
- };
- this.itemEnd = function ( url ) {
- loaded ++;
- if ( scope.onProgress !== undefined ) {
- scope.onProgress( url, loaded, total );
- }
- if ( loaded === total && scope.onLoad !== undefined ) {
- scope.onLoad();
- }
- };
- };
- THREE.DefaultLoadingManager = new THREE.LoadingManager();
|