Ejemplo n.º 1
0
        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);
        }
Ejemplo n.º 2
0
        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));
        }
Ejemplo n.º 3
0
        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));
        }