using UnityEngine;
using System.Collections;

public class SelfDestructor : MonoBehaviour {

    private ParticleSystem ps = null;

    void Start()
    {
        ps = (ParticleSystem) GetComponent(typeof(ParticleSystem));
    }

	void Update()
    {
        if (ps != null)
        {
            if (!ps.IsAlive())
            {
                Destroy(this.gameObject);
            }
        }
    }
}
