Пример #1
0
    private void OnTriggerExit(Collider collision)
    {
        GameObject other = collision.gameObject;

        if (other.tag.Equals("Element"))
        {
            ElementController ec = other.GetComponent <ElementController>();

            if (ec.ConductsElectricity())
            {
                GetComponent <ParticleSystem>().Stop();
                ParticleSystem.EmissionModule em = GetComponent <ParticleSystem>().emission;
                em.enabled = false;
            }
        }
    }