Bläddra i källkod

Canvas2D bug fix for Sprite2D

Only the Texture's URL was used to create the ModelRenderCache which bugs is two textures instances using the same URL were created (and disposed)
nockawa 8 år sedan
förälder
incheckning
506fd2330f
1 ändrade filer med 14 tillägg och 1 borttagningar
  1. 14 1
      canvas2D/src/Engine/babylon.smartPropertyPrim.ts

+ 14 - 1
canvas2D/src/Engine/babylon.smartPropertyPrim.ts

@@ -1057,7 +1057,20 @@
                         }
                     }
 
-                    modelKey += v.name + ":" + ((propVal != null) ? ((v.typeLevelCompare) ? Tools.getClassName(propVal) : propVal.toString()) : "[null]") + ";";
+                    let value = "[null]";
+                    if (propVal != null) {
+                        if (v.typeLevelCompare) {
+                            value = Tools.getClassName(propVal);
+                        } else {
+                            if (propVal instanceof BaseTexture) {
+                                value = propVal.uid;
+                            } else {
+                                value = propVal.toString();
+                            }
+                        }
+                    }
+
+                    modelKey += v.name + ":" + value + ";";
                 }
             });