@quenty/particles 1.1.0 → 2.0.0
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 -4
- package/src/Shared/ParticleEmitterUtils.lua +25 -0
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
|
+
# [2.0.0](https://github.com/Quenty/NevermoreEngine/compare/@quenty/particles@1.1.0...@quenty/particles@2.0.0) (2023-10-11)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Features
|
|
10
|
+
|
|
11
|
+
* Add ParticleEmitterUtils.playFromTemplate(template, attachment) ([1f0d5c2](https://github.com/Quenty/NevermoreEngine/commit/1f0d5c2782ffd59bff2d740186675be4e8bf801f))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
6
17
|
# 1.1.0 (2023-09-21)
|
|
7
18
|
|
|
8
19
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@quenty/particles",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.0",
|
|
4
4
|
"description": "Holds utilitity for playing back particles",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"Roblox",
|
|
@@ -25,11 +25,12 @@
|
|
|
25
25
|
"Quenty"
|
|
26
26
|
],
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@quenty/loader": "^
|
|
29
|
-
"@quenty/
|
|
28
|
+
"@quenty/loader": "^7.0.0",
|
|
29
|
+
"@quenty/maid": "^2.6.0",
|
|
30
|
+
"@quenty/numbersequenceutils": "^5.0.0"
|
|
30
31
|
},
|
|
31
32
|
"publishConfig": {
|
|
32
33
|
"access": "public"
|
|
33
34
|
},
|
|
34
|
-
"gitHead": "
|
|
35
|
+
"gitHead": "fdeae46099587019ec5fc15317dc673aed379400"
|
|
35
36
|
}
|
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
local require = require(script.Parent.loader).load(script)
|
|
6
6
|
|
|
7
7
|
local NumberSequenceUtils = require("NumberSequenceUtils")
|
|
8
|
+
local Maid = require("Maid")
|
|
8
9
|
|
|
9
10
|
local ParticleEmitterUtils = {}
|
|
10
11
|
|
|
@@ -16,6 +17,30 @@ function ParticleEmitterUtils.scaleSize(adornee, scale)
|
|
|
16
17
|
end
|
|
17
18
|
end
|
|
18
19
|
|
|
20
|
+
function ParticleEmitterUtils.playFromTemplate(template, attachment)
|
|
21
|
+
local maid = Maid.new()
|
|
22
|
+
|
|
23
|
+
for _, emitter in pairs(template:GetChildren()) do
|
|
24
|
+
local newEmitter = emitter:Clone()
|
|
25
|
+
newEmitter.Parent = attachment
|
|
26
|
+
maid:GiveTask(newEmitter)
|
|
27
|
+
|
|
28
|
+
local emitDelay = newEmitter:GetAttribute("EmitDelay")
|
|
29
|
+
local emitCount = newEmitter:GetAttribute("EmitCount")
|
|
30
|
+
|
|
31
|
+
if emitDelay then
|
|
32
|
+
maid:GiveTask(task.delay(emitDelay, function()
|
|
33
|
+
newEmitter:Emit(emitCount)
|
|
34
|
+
end))
|
|
35
|
+
else
|
|
36
|
+
newEmitter:Emit(emitCount)
|
|
37
|
+
end
|
|
38
|
+
end
|
|
39
|
+
|
|
40
|
+
return maid
|
|
41
|
+
|
|
42
|
+
end
|
|
43
|
+
|
|
19
44
|
function ParticleEmitterUtils.getParticleEmitters(adornee)
|
|
20
45
|
assert(typeof(adornee) == "Instance", "Bad adornee")
|
|
21
46
|
|