提交 a18a3b02 编写于 作者: M Mr.doob

Avoiding deprecated error message on SceneLoader too.

上级 ca2eecb3
......@@ -50,7 +50,7 @@ THREE.JSONLoader.prototype.loadAjaxJSON = function( context, url, callback, text
try {
var jsonObject = JSON.parse( xhr.responseText );
var json = JSON.parse( xhr.responseText );
} catch ( error ) {
......@@ -58,7 +58,7 @@ THREE.JSONLoader.prototype.loadAjaxJSON = function( context, url, callback, text
}
context.createModel( jsonObject, callback, texturePath );
context.createModel( json, callback, texturePath );
context.onLoadComplete();
} else {
......
......@@ -21,7 +21,7 @@ THREE.SceneLoader.prototype.load = function( url, callbackFinished ) {
var xhr = new XMLHttpRequest();
xhr.onreadystatechange = function() {
xhr.onreadystatechange = function () {
if ( xhr.readyState == 4 ) {
......@@ -31,22 +31,14 @@ THREE.SceneLoader.prototype.load = function( url, callbackFinished ) {
var json = JSON.parse( xhr.responseText );
if ( json.metadata === undefined || json.metadata.formatVersion === undefined || json.metadata.formatVersion !== 3 ) {
console.error( 'Deprecated file format.' );
return;
}
context.createScene( json, callbackFinished, url );
} catch ( error ) {
console.error( error );
console.warn( "DEPRECATED: [" + url + "] seems to be using old model format" );
}
context.createScene( json, callbackFinished, url );
} else {
console.error( "Couldn't load [" + url + "] [" + xhr.status + "]" );
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册