소스 검색

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();
 	}