private void OnTriggerEnter2D(Collider2D collision) { if (collision.tag.Equals("Player")) { Destroy(collision.gameObject); deathmenu.LoadDeathScreen(); } }
private void OnTriggerEnter2D(Collider2D collision) { if (collision.tag.Equals("DeathZone")) { Destroy(gameObject); deathmenu.LoadDeathScreen(); } if (collision.tag.Equals("Coins")) { /*CoinCollect.coinCount = +1; * CoinCollectSave.coin = +1; * Destroy(collision.gameObject);*/ CoinCount += 1; CoinCounter.text = "x" + CoinCount; Destroy(collision.gameObject); Debug.Log(CoinCount); } if (collision.tag.Equals("FinishZone")) { Time.timeScale = 0f; finishmenu.LoadWinScreen(); Destroy(gameObject); } }