Ejemplo n.º 1
0
    private void OnTriggerEnter(Collider other)
    {
        if (other.gameObject.tag == "Player" && other.gameObject.layer == 9)
        {
            // cambia el cada cuanto se instancian los disparos
            Disparador disp = other.gameObject.GetComponent <Disparador>();
            disp.repeatRate = disp.repeatRate + bonus;

            // instancio sistema de particulas
            EjecutarParticulas();
            sndPowerUp.Play();

            // retraso la destruccion para que se termine de ejecutar el sonido
            Invoke("Destruccion", 1.0f);
        }
    }