- Home /
The question is answered, right answer was accepted
How to get the amount of scenes in a build?
I would like to know how many scenes are in a build. I have a system which increases the level by 1 each time a level is passed. The problem is that ince the last level is reached, I'm referencing a scene which doesn't exist. I would like to loop back to the first level.
How do I get the amount of scenes in a build?
its now:
Scene$$anonymous$$anager.sceneCountInBuildSettings;
Answer by KalleH · Apr 12, 2015 at 02:27 PM
Hey!
Application.levelCount is probably what you are looking for as it returns the amount of scenes in your project.
Easily done. There's a lot of API to get through; unless you are gifted with Photographic $$anonymous$$emory :)
For those who are using Unity5+: given answer no longer works, ins$$anonymous$$d use Scene$$anonymous$$anager.sceneCountInBuildSettings
Follow this Question
Related Questions
Distribute terrain in zones 3 Answers
Reduce 'Levels' or Scene File Size 1 Answer
Get how many frames have passed in the current scene? 0 Answers
Cannot close/unload a scene that is open in editor during playmode (using C# code)? 3 Answers
Xbox 360 Controller Build Issue - Unity 2019.1.2f1 0 Answers