ソースを参照

Fix trails being updated by FX when removed from scene.

clementlandrin 1 年間 前
コミット
b7bd6eda88
1 ファイル変更10 行追加0 行削除
  1. 10 0
      hrt/prefab/l3d/Trails.hx

+ 10 - 0
hrt/prefab/l3d/Trails.hx

@@ -224,6 +224,16 @@ class TrailObj extends h3d.scene.Mesh {
 
 	override function onRemove() {
 		super.onRemove();
+		var p = parent;
+		var fxAnim : Array<hrt.prefab.fx.FX.FXAnimation> = [];
+		while ( p != null ) {
+			var fx = Std.downcast(p, hrt.prefab.fx.FX.FXAnimation);
+			if ( fx != null )
+				fxAnim.push(fx);
+			p = p.parent;
+		}
+		for ( fx in fxAnim )
+			fx.trails.remove(this);
 		dprim.dispose();
 	}