﻿using UnityEngine;
using System.Collections;

namespace Nostalgia.Example
{
	[AddComponentMenu("Nostalgia/Example/OneShotParticle"), RequireComponent(typeof(ParticleSystem))]
	public sealed class OneShotParticle : MonoBehaviour
	{
		ParticleSystem _ParticleSystem;
		void Awake()
		{
			_ParticleSystem = GetComponent<ParticleSystem>();
		}

		// Update is called once per frame
		void Update()
		{
			if (!_ParticleSystem.IsAlive(true))
			{
				Destroy(gameObject);
			}
		}
	}

}
