Files
HyperLap2D/src/main/java/games/rednblack/editor/system/ParticleContinuousSystem.java
T
fgnm 8adf63dff9 Move Editor to Artemis-based runtime:
* Epic artemis switch!
* Update to 0.0.8-SNAPSHOT
2021-08-07 18:07:09 +02:00

28 lines
932 B
Java

package games.rednblack.editor.system;
import com.artemis.annotations.All;
import com.badlogic.gdx.graphics.g2d.ParticleEffect;
import games.rednblack.editor.renderer.components.particle.ParticleComponent;
import games.rednblack.editor.renderer.systems.ParticleSystem;
/**
* Some particle panels might not be continuous, so they will stop after first iteration, which is ok
* This system will make sure they look continuous while in editor, so user will find and see them easily.
*
*/
@All(ParticleComponent.class)
public class ParticleContinuousSystem extends ParticleSystem {
@Override
protected void process(int entity) {
super.process(entity);
ParticleComponent particleComponent = particleComponentMapper.get(entity);
ParticleEffect particleEffect = particleComponent.particleEffect;
if (particleEffect.isComplete()) {
particleEffect.reset(false);
}
}
}