浏览代码

Source: Added id.

Mr.doob 2 年之前
父节点
当前提交
e296032db5
共有 1 个文件被更改,包括 4 次插入0 次删除
  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;