using UnityEngine;
using System.Collections;

[RequireComponent(typeof(ParticleSystem))]
public class RemoveAfterParticlesEnd : MonoBehaviour {

    private ParticleSystem _particleSystem;
    void Start()
    {
        _particleSystem = GetComponent<ParticleSystem>();
    }

    void Update()
    {
        if (!_particleSystem.isPlaying)
            Destroy(gameObject);
    }
}

