private void StopChargingFxs() { foreach (ParticleSystem PS in chargingPartSystList) { PS.Stop(); } foreach (ParticleSystem PS in chargingMainSystList) { PS.Stop(); } }
private void OnTriggerEnter(Collider other) { Instantiate(createThis, transform.position, transform.rotation, vfxPool.transform); Destroy(GetComponent <Rigidbody>()); Destroy(GetComponent <Renderer>()); p = GetComponentsInChildren <ParticleSystem>(); foreach (ParticleSystem PS in p) { PS.Stop(); } }
// Use this for initialization void OnCollisionEnter(Collision coll) { Instantiate(createThis, transform.position, transform.rotation); Destroy(GetComponent <Rigidbody>()); Destroy(GetComponent <Renderer>()); p = GetComponentsInChildren <ParticleSystem> (); foreach (ParticleSystem PS in p) { PS.Stop(); } }
IEnumerator coroutine(float endTime) { foreach (ParticleSystem PS in ParticleSystems) { PS.Play(); } if (hasEndTime) { yield return(new WaitForSeconds(endTime)); foreach (ParticleSystem PS in ParticleSystems) { PS.Stop(); } } }