- Home /
Changing build index of scene
Hi,
is there a way I can change the build index of a scene? I want to make the index to 100 / 200 / 300 so I can refer to my levels as easy/ moderate/ hard. That way I can just order the levels in easy as 101,102... so index%100 would give me the level number in the current difficulty.
Thank you in advance!
Answer by Zoedingl · Aug 02, 2020 at 04:20 PM
Hello, I don`t know any way to do this. I understand your idea, but the only way to change the build index is by changing this in the build settings. You could create a method which would load a scene from an "ID". The idea is , that you assign ID`s 101,102... to certain levels.
Let`s say, you get the index of the first level in each category on start and you assign these ID`s to the levels from the index of the first level in each category to the first level in the next category - 1 by index. I hope you understand my idea. Example:
private int easyIndex;
private int mediumIndex;
private int hardIndex;
void Start() {
easyIndex = //Get first scene of the easy category by name
mediumIndex = //...
hardIndex = //...
//Loop through all the types levels and create either an array or a class with the ID`s and assign the values
}
//Method to return the scene by it`s ID
Now you can load the scene by its ID. I hope this helped you.
:D
P.S.: If i was unclear in describing my idea, just tell me, I will try to explain it again. :)
Your answer
Follow this Question
Related Questions
Distribute terrain in zones 3 Answers
Does Unity cull away unused assets on build time? 1 Answer
Game Objects are not visible in build of my 2D Games 0 Answers
releasing a demo to app store 0 Answers
Got a Photon project; What's next? 2 Answers