public void getLivesCountAfterAddLife() { Death death = new Death(); int currentLivesCount = death.getLivesCount(); death.addLivesCount(); Assert.AreEqual(currentLivesCount++, death.getLivesCount()); }
//обрабатываем взаимодействие с игроком private void OnTriggerEnter2D(Collider2D collision) { if (collision.gameObject.CompareTag("Player")) { Death player = collision.gameObject.GetComponent <Death>(); player.addLivesCount(); Destroy(gameObject); } }