浏览代码

Merge pull request #12887 from takahirox/MethodChaining

Enable LoadingManager and GLTFLoader Method chaining
Mr.doob 7 年之前
父节点
当前提交
97e7bf605d
共有 2 个文件被更改,包括 3 次插入0 次删除
  1. 2 0
      examples/js/loaders/GLTFLoader.js
  2. 1 0
      src/loaders/LoadingManager.js

+ 2 - 0
examples/js/loaders/GLTFLoader.js

@@ -57,12 +57,14 @@ THREE.GLTFLoader = ( function () {
 		setCrossOrigin: function ( value ) {
 
 			this.crossOrigin = value;
+			return this;
 
 		},
 
 		setPath: function ( value ) {
 
 			this.path = value;
+			return this;
 
 		},
 

+ 1 - 0
src/loaders/LoadingManager.js

@@ -83,6 +83,7 @@ function LoadingManager( onLoad, onProgress, onError ) {
 	this.setURLModifier = function ( transform ) {
 
 		urlModifier = transform;
+		return this;
 
 	};