summaryrefslogtreecommitdiff
path: root/ROUNDS/SetParticleTimeAfterSecondsToRemove.cs
diff options
context:
space:
mode:
Diffstat (limited to 'ROUNDS/SetParticleTimeAfterSecondsToRemove.cs')
-rw-r--r--ROUNDS/SetParticleTimeAfterSecondsToRemove.cs13
1 files changed, 13 insertions, 0 deletions
diff --git a/ROUNDS/SetParticleTimeAfterSecondsToRemove.cs b/ROUNDS/SetParticleTimeAfterSecondsToRemove.cs
new file mode 100644
index 0000000..8229d6a
--- /dev/null
+++ b/ROUNDS/SetParticleTimeAfterSecondsToRemove.cs
@@ -0,0 +1,13 @@
+using UnityEngine;
+
+public class SetParticleTimeAfterSecondsToRemove : MonoBehaviour
+{
+ private void Start()
+ {
+ ParticleSystem component = GetComponent<ParticleSystem>();
+ component.Stop();
+ ParticleSystem.MainModule main = component.main;
+ main.duration = GetComponentInParent<RemoveAfterSeconds>().seconds - main.startLifetime.constant;
+ component.Play();
+ }
+}