@quenty/particles 5.9.1 → 5.9.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +11 -0
- package/package.json +5 -5
- package/src/Shared/ParticleEmitterUtils.lua +13 -8
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,17 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [5.9.2](https://github.com/Quenty/NevermoreEngine/compare/@quenty/particles@5.9.1...@quenty/particles@5.9.2) (2025-04-05)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* Add types to packages ([2374fb2](https://github.com/Quenty/NevermoreEngine/commit/2374fb2b043cfbe0e9b507b3316eec46a4e353a0))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
6
17
|
## [5.9.1](https://github.com/Quenty/NevermoreEngine/compare/@quenty/particles@5.9.0...@quenty/particles@5.9.1) (2025-03-21)
|
|
7
18
|
|
|
8
19
|
**Note:** Version bump only for package @quenty/particles
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@quenty/particles",
|
|
3
|
-
"version": "5.9.
|
|
3
|
+
"version": "5.9.2",
|
|
4
4
|
"description": "Holds utilitity for playing back particles",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"Roblox",
|
|
@@ -25,12 +25,12 @@
|
|
|
25
25
|
"Quenty"
|
|
26
26
|
],
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@quenty/loader": "^10.8.
|
|
29
|
-
"@quenty/maid": "^3.4.
|
|
30
|
-
"@quenty/numbersequenceutils": "^8.9.
|
|
28
|
+
"@quenty/loader": "^10.8.1",
|
|
29
|
+
"@quenty/maid": "^3.4.1",
|
|
30
|
+
"@quenty/numbersequenceutils": "^8.9.2"
|
|
31
31
|
},
|
|
32
32
|
"publishConfig": {
|
|
33
33
|
"access": "public"
|
|
34
34
|
},
|
|
35
|
-
"gitHead": "
|
|
35
|
+
"gitHead": "78c3ac0ab08dd18085b6e6e6e4f745e76ed99f68"
|
|
36
36
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
--!strict
|
|
1
2
|
--[=[
|
|
2
3
|
Standard playback of particles using `EmitDelay` and `EmitCount` attributes that
|
|
3
4
|
most standard particle editors emit.
|
|
@@ -15,10 +16,10 @@ local ParticleEmitterUtils = {}
|
|
|
15
16
|
--[=[
|
|
16
17
|
Scales the size of the particle emitter to a specified size
|
|
17
18
|
]=]
|
|
18
|
-
function ParticleEmitterUtils.scaleSize(adornee: Instance, scale: number)
|
|
19
|
+
function ParticleEmitterUtils.scaleSize(adornee: Instance, scale: number): ()
|
|
19
20
|
assert(typeof(adornee) == "Instance", "Bad adornee")
|
|
20
21
|
|
|
21
|
-
for _, particleEmitter in
|
|
22
|
+
for _, particleEmitter in ParticleEmitterUtils.getParticleEmitters(adornee) do
|
|
22
23
|
particleEmitter.Size = NumberSequenceUtils.scale(particleEmitter.Size, scale)
|
|
23
24
|
end
|
|
24
25
|
end
|
|
@@ -29,18 +30,22 @@ end
|
|
|
29
30
|
@param template Instance
|
|
30
31
|
@return Maid
|
|
31
32
|
]=]
|
|
32
|
-
function ParticleEmitterUtils.playFromTemplate(template: Instance, attachment: Attachment)
|
|
33
|
+
function ParticleEmitterUtils.playFromTemplate(template: Instance, attachment: Attachment): Maid.Maid
|
|
33
34
|
local maid = Maid.new()
|
|
34
35
|
|
|
35
|
-
for _, emitter in
|
|
36
|
+
for _, emitter in ParticleEmitterUtils.getParticleEmitters(template) do
|
|
36
37
|
local newEmitter = emitter:Clone()
|
|
37
38
|
newEmitter.Parent = attachment
|
|
38
39
|
maid:GiveTask(newEmitter)
|
|
39
40
|
|
|
40
41
|
local emitDelay = newEmitter:GetAttribute("EmitDelay")
|
|
41
|
-
local
|
|
42
|
+
local unparsedEmitCount = newEmitter:GetAttribute("EmitCount")
|
|
43
|
+
local emitCount: number?
|
|
44
|
+
if type(unparsedEmitCount) ~= "number" then
|
|
45
|
+
emitCount = nil
|
|
46
|
+
end
|
|
42
47
|
|
|
43
|
-
if emitDelay then
|
|
48
|
+
if type(emitDelay) == "number" then
|
|
44
49
|
maid:GiveTask(task.delay(emitDelay, function()
|
|
45
50
|
newEmitter:Emit(emitCount)
|
|
46
51
|
end))
|
|
@@ -58,13 +63,13 @@ end
|
|
|
58
63
|
function ParticleEmitterUtils.getParticleEmitters(adornee: Instance): { ParticleEmitter }
|
|
59
64
|
assert(typeof(adornee) == "Instance", "Bad adornee")
|
|
60
65
|
|
|
61
|
-
local emitters = {}
|
|
66
|
+
local emitters: { ParticleEmitter } = {}
|
|
62
67
|
|
|
63
68
|
if adornee:IsA("ParticleEmitter") then
|
|
64
69
|
table.insert(emitters, adornee)
|
|
65
70
|
end
|
|
66
71
|
|
|
67
|
-
for _, particleEmitter in
|
|
72
|
+
for _, particleEmitter in adornee:GetDescendants() do
|
|
68
73
|
if particleEmitter:IsA("ParticleEmitter") then
|
|
69
74
|
table.insert(emitters, particleEmitter)
|
|
70
75
|
end
|