瀏覽代碼

Merge branch 'master' of https://github.com/Nockawa/Babylon.js.git

nockawa 8 年之前
父節點
當前提交
d359b4654f
共有 1 個文件被更改,包括 9 次插入0 次删除
  1. 9 0
      src/Materials/Textures/babylon.baseTexture.ts

+ 9 - 0
src/Materials/Textures/babylon.baseTexture.ts

@@ -33,6 +33,13 @@
         @serialize()
         public isRenderTarget = false;
 
+        public get uid(): string {
+            if (!this._uid) {
+                this._uid = Tools.RandomId();
+            }
+            return this._uid;
+        }
+
         public toString(): string {
             return this.name;
         }
@@ -59,10 +66,12 @@
 
         private _scene: Scene;
         public _texture: WebGLTexture;
+        private _uid: string;
 
         constructor(scene: Scene) {
             this._scene = scene;
             this._scene.textures.push(this);
+            this._uid = null;
         }
 
         public getScene(): Scene {