浏览代码

Add burst at 0 for emitter

ShiroSmith 5 年之前
父节点
当前提交
f69ec5553e
共有 1 个文件被更改,包括 2 次插入2 次删除
  1. 2 2
      hrt/prefab/fx/Emitter.hx

+ 2 - 2
hrt/prefab/fx/Emitter.hx

@@ -757,7 +757,7 @@ class EmitterObject extends h3d.scene.Object {
 						enable = false;
 				case BurstDuration:
 					if( burstDelay > 0 ) {
-						var burstTarget = hxd.Math.floor(curTime / burstDelay);
+						var burstTarget = 1 + hxd.Math.floor(curTime / burstDelay);
 						var lastBurstTime = totalBurstCount * burstDelay;
 						var nextBurstTime = lastBurstTime + burstDelay;
 						var needBurst = nextBurstTime <= emitDuration && totalBurstCount < burstTarget;
@@ -774,7 +774,7 @@ class EmitterObject extends h3d.scene.Object {
 						enable = false;
 				case Burst:
 					if( burstDelay > 0 ) {
-						var burstTarget = hxd.Math.min(burstCount, hxd.Math.floor(curTime / burstDelay));
+						var burstTarget = hxd.Math.min(burstCount, 1 + hxd.Math.floor(curTime / burstDelay));
 						while( totalBurstCount < burstTarget ) {
 							var delta = hxd.Math.ceil(hxd.Math.min(maxCount - numInstances, burstParticleCount));
 							doEmit(delta);