void OnTriggerEnter2D(Collider2D col) { Scene cs = SceneManager.GetActiveScene(); if (cs.name != "FroggerLevel3") { audioSrc.PlayOneShot(levelUp); Debug.Log("Level up!"); _freezer.FreezeAndNextScene(); } else { audioSrc.PlayOneShot(winSound); Debug.Log("You win!"); _freezer.FreezeAndEnd(); } }
void OnTriggerEnter2D(Collider2D col) { if (col.tag == "bird") { hit(); } if (col.tag == "PickUp") { coinBar.add(); audioSrc.PlayOneShot(money); Debug.Log("one coin!"); // _freezer.Freeze(); Destroy(col.gameObject); if (coinBar.get() == maxCoins) { ngrSrc.PlayOneShot(winSound); Debug.Log("You win!"); _freezer.FreezeAndEnd(); } } }