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

Material: Added needsUpdate getter/setter.

上级 90918361
......@@ -39,7 +39,7 @@ THREE.Material = function () {
this.visible = true;
this.needsUpdate = true;
this._needsUpdate = true;
};
......@@ -47,6 +47,20 @@ THREE.Material.prototype = {
constructor: THREE.Material,
get needsUpdate () {
return this._needsUpdate;
},
set needsUpdate ( value ) {
if ( value === true ) this.update();
this._needsUpdate = value;
},
setValues: function ( values ) {
if ( values === undefined ) return;
......@@ -198,6 +212,12 @@ THREE.Material.prototype = {
},
update: function () {
this.dispatchEvent( { type: 'update' } );
},
dispose: function () {
this.dispatchEvent( { type: 'dispose' } );
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册