So yeah I want to make that if you want to unlock a next level you have to collect exact amount of coins to proceed to next level or unlock it buying with game currency. 2 options to unlock a level.
For the next level based on coin collection, add an event observer to the UI for that level and the number of coins you want to have to collect to move to next. Then on the menu UI where someone can unlock worlds, you put a "lock" button on the UI for each level/world you want to have unlockable and the "price" of what you want to have it unlockable.
Kind of depends on how you are setting up things. How many scenes do you have and are you using worlds? What happens when the user gets to the end of the scene, do you want them to loop back through until they hit the coin number?