Explorar o código

Source: Added id.

Mr.doob %!s(int64=2) %!d(string=hai) anos
pai
achega
e296032db5
Modificáronse 1 ficheiros con 4 adicións e 0 borrados
  1. 4 0
      src/textures/Source.js

+ 4 - 0
src/textures/Source.js

@@ -1,12 +1,16 @@
 import { ImageUtils } from '../extras/ImageUtils.js';
 import * as MathUtils from '../math/MathUtils.js';
 
+let sourceId = 0;
+
 class Source {
 
 	constructor( data = null ) {
 
 		this.isSource = true;
 
+		Object.defineProperty( this, 'id', { value: sourceId ++ } );
+
 		this.uuid = MathUtils.generateUUID();
 
 		this.data = data;