瀏覽代碼

Fx2d : particles fix emitLoop

Tom Spira 2 年之前
父節點
當前提交
788334d376
共有 1 個文件被更改,包括 9 次插入0 次删除
  1. 9 0
      hrt/prefab/l2d/Particle2D.hx

+ 9 - 0
hrt/prefab/l2d/Particle2D.hx

@@ -28,6 +28,12 @@ class Particles extends h2d.Particles {
 		randomSeed = Std.random(0xFFFFFF);
 		randomSeed = Std.random(0xFFFFFF);
 		random = new hxd.Rand(randomSeed);
 		random = new hxd.Rand(randomSeed);
 		evaluator = new Evaluator();
 		evaluator = new Evaluator();
+		onEnd = function() {
+			for( g in groups ) {
+				if( g.emitLoop )
+					@:privateAccess g.needRebuild = true;
+			}
+		}
 	}
 	}
 
 
 	function tick( dt : Float, full=true) {
 	function tick( dt : Float, full=true) {
@@ -46,6 +52,9 @@ class Particles extends h2d.Particles {
 	}
 	}
 
 
 	public function reset() {
 	public function reset() {
+		for( g in groups ) {
+			@:privateAccess g.needRebuild = true;
+		}
 		random.init(randomSeed);
 		random.init(randomSeed);
 		curTime = 0.0;
 		curTime = 0.0;
 		lastTime = 0.0;
 		lastTime = 0.0;