Exemple #1
0
 /// <summary>
 /// Player picks up gem, play sound and update inventory
 /// </summary>
 /// <param name="collision"></param>
 private void OnTriggerEnter2D(Collider2D collision)
 {
     if (collision.tag == "Player" && pickedUp == false)
     {
         pickedUp = true;
         GetComponent <SpriteRenderer>().enabled = false;
         ManagerUI.GotGem();
         ManagerUI.score += 50;
         GetComponent <AudioSource>().Play();
         Destroy(gameObject, 1);
     }
 }