Skip to content

Instantly share code, notes, and snippets.

@rawo2010
Last active March 1, 2018 05:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rawo2010/9d6a183386ec737312f46b0cf23b7ecf to your computer and use it in GitHub Desktop.
Save rawo2010/9d6a183386ec737312f46b0cf23b7ecf to your computer and use it in GitHub Desktop.
using UnityEngine ;
[RequireComponent(typeof(ParticleSystem))]
public class AutoDestoryPartcle : MonoBehaviour {
void Start () {
ParticleSystem partcleSystem = GetComponent<ParticleSystem>() ;
//Delete object after duration.
Destroy(gameObject,(float)partcleSystem.main.duration ) ;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment