RunAssociatedEffect()

public void RunAssociatedEffect(string particleSys = "", bool systemOnly = false)
    {
        foreach (GameObject particle in particleSystems)
        {
            if (particle != null)
            {
                if (particle.name == particleSys)
                {
                    particle.SetActive(true);
                    currentlyRunning = particle;
                    break;
                }
            }
        }

        if (currentlyRunning == null)
        {
            animationOnly = particleSys;
        }

        if (particleSys == "")
        {
            return;
        }

        if (!systemOnly && particleSys != "" && animator != null)
        {
            animator.SetBool(particleSys, true);
        }
    }


Comments

Leave a Reply

Your email address will not be published. Required fields are marked *