فهرست منبع

Add uniqueid to material

Kacey Coley 7 سال پیش
والد
کامیت
c8af57bc87
1فایلهای تغییر یافته به همراه7 افزوده شده و 0 حذف شده
  1. 7 0
      src/Materials/babylon.material.ts

+ 7 - 0
src/Materials/babylon.material.ts

@@ -395,6 +395,12 @@
         public id: string;
 
         /**
+         * Gets or sets the unique id of the material
+         */
+        @serialize()
+        public uniqueId: number;
+
+        /**
          * The name of the material
          */
         @serialize()
@@ -776,6 +782,7 @@
             this.id = name || Tools.RandomId();
 
             this._scene = scene || Engine.LastCreatedScene;
+            this.uniqueId = this._scene.getUniqueId();
 
             if (this._scene.useRightHandedSystem) {
                 this.sideOrientation = Material.ClockWiseSideOrientation;