Last active
March 1, 2018 05:52
-
-
Save rawo2010/9d6a183386ec737312f46b0cf23b7ecf to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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