summaryrefslogtreecommitdiff
path: root/ROUNDS/SetParticleTimeAfterSecondsToRemove.cs
blob: 8229d6a01fc676de3907d66b76d96eac51b5428b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
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();
	}
}