読者です 読者をやめる 読者になる 読者になる

How to recycle unity shuriken particle

private GameObject particleCache;

if (particleCache == null) {
    particleCache = Instantiate (attackParticle, enemy.transform.position, Quaternion.identity) as GameObject;
} 
else {
    // 再発火
    particleCache.GetComponent<ParticleSystem>().Clear();
    particleCache.GetComponent<ParticleSystem>().Play();
}