浏览代码

ShaderTarget: fix shader target disabled that was still used

lviguier 7 月之前
父节点
当前提交
91ea48357a
共有 1 个文件被更改,包括 4 次插入1 次删除
  1. 4 1
      hrt/prefab/fx/FX.hx

+ 4 - 1
hrt/prefab/fx/FX.hx

@@ -53,8 +53,11 @@ class FXAnimation extends h3d.scene.Object {
 		if(root == null)
 			root = def;
 
-		for (shaderTarget in def.flatten(hrt.prefab.fx.ShaderTarget))
+		for (shaderTarget in def.flatten(hrt.prefab.fx.ShaderTarget)) {
+			if (!shaderTarget.enabled)
+				continue;
 			shaderTarget.applyShaderTarget(def, shaderTarget.target);
+		}
 
 		initObjAnimations(root);
 		initEmitters(root);