Exemplo n.º 1
0
    public void getLivesCountAfterAddLife()
    {
        Death death             = new Death();
        int   currentLivesCount = death.getLivesCount();

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