瀏覽代碼

MaterialLoader: Simplified code. The material constructor already generates a uuid.

Mr.doob 9 年之前
父節點
當前提交
6342b26a84
共有 1 個文件被更改,包括 1 次插入5 次删除
  1. 1 5
      src/loaders/MaterialLoader.js

+ 1 - 5
src/loaders/MaterialLoader.js

@@ -49,12 +49,8 @@ THREE.MaterialLoader.prototype = {
 	parse: function ( json ) {
 
 		var material = new THREE[ json.type ];
-		if ( json.uuid !== undefined) {
-			material.uuid = json.uuid;
-		} else {
-			material.uuid = THREE.Math.generateUUID();
-		}
 
+		if ( json.uuid !== undefined ) material.uuid = json.uuid;
 		if ( json.name !== undefined ) material.name = json.name;
 		if ( json.color !== undefined ) material.color.setHex( json.color );
 		if ( json.roughness !== undefined ) material.roughness = json.roughness;