示例#1
0
 private void OnTriggerEnter2D(Collider2D collisor)
 {
     if (collisor.tag == "Mosquitos")
     {
         collisor.GetComponent <Item>().InstanciarDestruir();
         Audio(clipMosquito);
         pontos.Hit();
     }
 }
示例#2
0
    void OnMouseDown()
    {
        switch (gameObject.tag)
        {
        case "badfood":
            GetComponent <AudioSource> ().Play();
            Destroy(gameObject);
            if (!vidas.Remover())
            {
                pontos.Recorde();
            }
            break;

        case "Goodfood":
            pontos.Hit();
            Destroy(gameObject);
            break;

        default:
            break;
        }
    }