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

JSONLoader: More robust metadata.type check. Fixes #7266.

上级 80c4bbab
......@@ -53,17 +53,23 @@ THREE.JSONLoader.prototype = {
if ( metadata !== undefined ) {
if ( metadata.type === 'object' ) {
var type = metadata.type;
console.error( 'THREE.JSONLoader: ' + url + ' should be loaded with THREE.ObjectLoader instead.' );
return;
if ( type !== undefined ) {
}
if ( type.toLowerCase() === 'object' ) {
console.error( 'THREE.JSONLoader: ' + url + ' should be loaded with THREE.ObjectLoader instead.' );
return;
}
if ( type.toLowerCase() === 'scene' ) {
if ( metadata.type === 'scene' ) {
console.error( 'THREE.JSONLoader: ' + url + ' should be loaded with THREE.SceneLoader instead.' );
return;
console.error( 'THREE.JSONLoader: ' + url + ' should be loaded with THREE.SceneLoader instead.' );
return;
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册