Exemple #1
0
    public void OnTriggerEnter2D(Collider2D collision)
    {
        if (collision.gameObject.tag == basuraCorrecta)
        {
            puntaje.score += 1;

            Destroy(collision.gameObject);

            spawner.canCreate = true;

            Vibration.Vibrate(60);

            Debug.Log("colision");

            reproductor.ReproducirBueno();

            Vector3 v3 = new Vector3(transform.position.x, transform.position.y + 4, transform.position.z);

            Instantiate(particula1, v3, Quaternion.identity);
        }
    }
Exemple #2
0
    private void OnMouseDown()
    {
        if (gameObject.CompareTag("Bullet"))
        {
            puntos.score += 1;
            Debug.Log("Objeto Destruido");
            Instantiate(particula1, transform.position, Quaternion.identity);
            Vibration.Vibrate(60);
            Destroy(gameObject);

            reproductorAudio.ReproducirBueno();
        }
        if (gameObject.CompareTag("BadBullet"))
        {
            puntos.score -= 2;
            Debug.Log("Objeto Destruido");
            Instantiate(particula2, transform.position, Quaternion.identity);
            Vibration.Vibrate(60);
            Destroy(gameObject);

            reproductorAudio.ReproducirMalo();
        }
    }