Răsfoiți Sursa

Editor: Avoid dispatching unneeded events when adding materials.

Mr.doob 5 ani în urmă
părinte
comite
a74cd7f830
1 a modificat fișierele cu 2 adăugiri și 0 ștergeri
  1. 2 0
      editor/js/Editor.js

+ 2 - 0
editor/js/Editor.js

@@ -231,6 +231,8 @@ Editor.prototype = {
 
 	addMaterial: function ( material ) {
 
+		if ( material.uuid in this.materials ) return;
+
 		this.materials[ material.uuid ] = material;
 		this.signals.materialAdded.dispatch();