Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Reviewed] [3D particle] Fix to avoid particles from keep displaying when the last instance is deleted #1334

Merged
merged 1 commit into from
Jul 12, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 17 additions & 2 deletions extensions/reviewed/ParticleEmitter3D.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"name": "ParticleEmitter3D",
"previewIconUrl": "https://asset-resources.gdevelop.io/public-resources/Icons/f2e5a34bf465f781866677762d385d6c8e9e8d203383f2df9a3b7e0fad6a2cb5_fire.svg",
"shortDescription": "Display a large number of particles to create visual effects.",
"version": "2.0.0",
"version": "2.0.1",
"description": [
"Particle emitters can be used to display:",
"- Fire",
Expand Down Expand Up @@ -39,6 +39,8 @@
"IWykYNRvhCZBN3vEgKEbBPOR3Oc2"
],
"dependencies": [],
"globalVariables": [],
"sceneVariables": [],
"eventsFunctions": [
{
"description": "Define helper classes JavaScript code.",
Expand Down Expand Up @@ -6983,7 +6985,20 @@
"object.__particleSystem.dispose();",
"",
"// See doStepPostEvents",
"gameScene.__particleEmmiter3DExtension.emittersCount--;"
"gameScene.__particleEmmiter3DExtension.emittersCount--;",
"",
"if (gameScene.__particleEmmiter3DExtension.emittersCount === 0) {",
" // Update batch system now because doStepPostEvents won't be called.",
" gameScene.__particleEmmiter3DExtension.layerNames = gameScene.__particleEmmiter3DExtension.layerNames || [];",
" const layerNames = gameScene.__particleEmmiter3DExtension.layerNames;",
" gameScene.getAllLayerNames(layerNames);",
" for (const layerName of layerNames) {",
" const layer = gameScene.getLayer(layerName);",
" if (layer.__particleEmmiter3DExtension) {",
" layer.__particleEmmiter3DExtension.batchSystem.update(object.getElapsedTime() / 1000);",
" }",
" }",
"}"
],
"parameterObjects": "Object",
"useStrict": true,
Expand Down
Loading