public static ParticleSystem Play(this ParticleSystem ps, ParticlesFX particlesFX, float scaleMultiplier) { ps.transform.localScale = Vector3.one * particlesFX.size * scaleMultiplier; ParticleSystem[] particlesChildren = GetParticlesChildren(ps); for (int i = 0; i < particlesChildren.Length; i++) { var main = particlesChildren[i].main; main.simulationSpeed = particlesFX.playbackSpeed; } for (int i = 0; i < particlesChildren.Length; i++) { particlesChildren[i].Play(false); } return(ps); }
public static ParticleSystem Play(ParticlesFX particlesFX, Transform parent, Vector3 localPosition, Quaternion localRotation, float scaleMultiplier) { ParticleSystem ps = pool.GetAvailable(particlesFX.particle, parent, true, localPosition, localRotation, OnParticleSystemPrefabCreate, null); return(ps.Play(particlesFX, scaleMultiplier)); }
public static ParticleSystem Play(ParticlesFX particlesFX, Vector3 position, Quaternion rotation, float scaleMultiplier) { ParticleSystem ps = pool.GetAvailable(particlesFX.particle, null, true, position, rotation, OnParticleSystemPrefabCreate, null); return(ps.Play(particlesFX, scaleMultiplier)); }