浏览代码

Fix: Block RenderTargetTexture clone when cloning a material

http://www.html5gamedevs.com/topic/33410-trouble-with-rendertargettexture-clone-function/
Nicolas Buecher 7 年之前
父节点
当前提交
70275fc80d
共有 1 个文件被更改,包括 3 次插入1 次删除
  1. 3 1
      src/Tools/babylon.decorators.ts

+ 3 - 1
src/Tools/babylon.decorators.ts

@@ -24,7 +24,6 @@
                     case 6:     // Mesh reference
                         (<any>destination)[property] = sourceProperty;
                         break;
-                    case 1:     // Texture
                     case 2:     // Color3
                     case 3:     // FresnelParameters
                     case 4:     // Vector2
@@ -32,6 +31,9 @@
                     case 7:     // Color Curves
                         (<any>destination)[property] = instanciate?sourceProperty:sourceProperty.clone();
                         break;
+                    case 1:     // Texture
+                        (<any>destination)[property] = (instanciate||sourceProperty.isRenderTarget)?sourceProperty:sourceProperty.clone();
+                        break;
                 }
             }
         }