diff options
Diffstat (limited to 'GameCode/SetParticleTimeAfterSecondsToRemove.cs')
-rw-r--r-- | GameCode/SetParticleTimeAfterSecondsToRemove.cs | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/GameCode/SetParticleTimeAfterSecondsToRemove.cs b/GameCode/SetParticleTimeAfterSecondsToRemove.cs new file mode 100644 index 0000000..8229d6a --- /dev/null +++ b/GameCode/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(); + } +} |