Browse Source

Add burst at 0 for emitter

ShiroSmith 5 years ago
parent
commit
f69ec5553e
1 changed files with 2 additions and 2 deletions
  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;
 						enable = false;
 				case BurstDuration:
 				case BurstDuration:
 					if( burstDelay > 0 ) {
 					if( burstDelay > 0 ) {
-						var burstTarget = hxd.Math.floor(curTime / burstDelay);
+						var burstTarget = 1 + hxd.Math.floor(curTime / burstDelay);
 						var lastBurstTime = totalBurstCount * burstDelay;
 						var lastBurstTime = totalBurstCount * burstDelay;
 						var nextBurstTime = lastBurstTime + burstDelay;
 						var nextBurstTime = lastBurstTime + burstDelay;
 						var needBurst = nextBurstTime <= emitDuration && totalBurstCount < burstTarget;
 						var needBurst = nextBurstTime <= emitDuration && totalBurstCount < burstTarget;
@@ -774,7 +774,7 @@ class EmitterObject extends h3d.scene.Object {
 						enable = false;
 						enable = false;
 				case Burst:
 				case Burst:
 					if( burstDelay > 0 ) {
 					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 ) {
 						while( totalBurstCount < burstTarget ) {
 							var delta = hxd.Math.ceil(hxd.Math.min(maxCount - numInstances, burstParticleCount));
 							var delta = hxd.Math.ceil(hxd.Math.min(maxCount - numInstances, burstParticleCount));
 							doEmit(delta);
 							doEmit(delta);