广告引擎粒子系统更新了多少粒子

时间:2012-08-23 08:49:57

标签: android andengine particle-system

我需要了解如何或某些代码示例或与此相关的任何内容。

我制作了一些粒子系统,这里我将从尼古拉斯的例子中展示

final SpriteParticleSystem particleSystem = new SpriteParticleSystem(new PointParticleEmitter(-32, ParticleSystemNexusExample.CAMERA_HEIGHT - 32),
                                                                     ParticleSystemNexusExample.RATE_MIN, 
                                                                     ParticleSystemNexusExample.RATE_MAX, 
                                                                     ParticleSystemNexusExample.PARTICLES_MAX, 
                                                                     this.mParticleTextureRegion, this.getVertexBufferObjectManager());  

我需要的是“LIVE”更新变量

private static final float RATE_MIN = 5;
private static final float RATE_MAX = 8;
private static int PARTICLES_MAX = 16;

以下代码中的var

ParticleSystemNexusExample.RATE_MIN
ParticleSystemNexusExample.RATE_MAX
ParticleSystemNexusExample.PARTICLES_MAX

在某种程度上可能吗? 有可能以某种方式重新启动粒子系统。 好重新启动它不是100%“实时”更新系统,但我需要像使用设置一样留在应用程序中,当你退出设置时它将获得新的变量。

基本上我有onCreateScene ParticleSystem();

我使用public void ParticleSystem() {}

可以重启吗?

1 个答案:

答案 0 :(得分:0)

目前还不是很清楚你想要做什么,但是Nicholas将最小和最大速率变量保留在ParticleSystem类上。我不确定你能得到什么样的行为,但是你可以尝试为它添加一个公共接口并实时更新它以查看会发生什么。如果你不想搞乱AndEngine平台代码,这里有一个建议:

您可以创建两个或更多具有不同费率的粒子系统,并根据您的需要在屏幕上管理它们。如果您只想交换它们一次,只需将第一个分开并附加第二个。如果要在它们之间不断更改,可以使用setParticlesSpawnEnabled来确定哪个是活动的。

干杯!

相关问题