Пример #1
0
 void OnTriggerEnter2D(Collider2D other)
 {
     if (other.gameObject.tag == "Player")
     {
         int itemAmount = Random.Range(1, 3);
         scoreManager.AddItem(itemAmount);
         Destroy(gameObject);
     }
 }