Esempio n. 1
0
    private void OnTriggerEnter(Collider other)
    {
        if (other.transform.CompareTag("Enemy") && !gameOver)
        {
            StartCoroutine(DestroyPlayer());
        }

        if (other.transform.CompareTag("Finish"))
        {
            gameWin.Invoke();
            StartCoroutine(DelayGameWin());
        }
    }
Esempio n. 2
0
 private void OnTriggerEnter(Collider other)
 {
     if (other.transform.CompareTag("Player"))
     {
         gameManager.IncreaseCoins(value);
         parent.gameObject.SetActive(false);
         enterPlayer.Invoke();
     }
 }
Esempio n. 3
0
    IEnumerator DestroyPlayer()
    {
        playerDestroy.Invoke();
        gameOver = true;
        particleSys.Play();
        mesh.enabled = false;
        yield return(new WaitForSeconds(particleSys.main.duration));

        gameManager.GameOver();
    }