Skip to content

Commit

Permalink
[Reviewed] [3D particle] Fix to avoid particles from keep displaying …
Browse files Browse the repository at this point in the history
…when the last instance is deleted
  • Loading branch information
D8H committed Jul 12, 2024
1 parent 238b3d9 commit d04bdbe
Showing 1 changed file with 50 additions and 3 deletions.
53 changes: 50 additions & 3 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 Expand Up @@ -9750,7 +9765,39 @@
"objectName": "Particle"
}
]
}
},
"objectsGroups": [],
"layers": [
{
"ambientLightColorB": 200,
"ambientLightColorG": 200,
"ambientLightColorR": 200,
"camera3DFarPlaneDistance": 10000,
"camera3DFieldOfView": 45,
"camera3DNearPlaneDistance": 3,
"cameraType": "",
"followBaseLayerCamera": false,
"isLightingLayer": false,
"isLocked": false,
"name": "",
"renderingType": "",
"visibility": true,
"cameras": [
{
"defaultSize": true,
"defaultViewport": true,
"height": 0,
"viewportBottom": 1,
"viewportLeft": 0,
"viewportRight": 1,
"viewportTop": 0,
"width": 0
}
],
"effects": []
}
],
"instances": []
}
]
}

0 comments on commit d04bdbe

Please sign in to comment.