|
Hi, I'm trying to create a level menu where i use a grid of button to represent the level and when i click on them it should load the particular level this is the code i'm using The problem is when the menu loads up the value of selectionGridInt is always 0 and therefore it loads up the first level by default instantly. There is something i'm obviously doing wrong but can't figure out.. Could someone help me out?
(comments are locked)
|
|
One possibility is to have a separate button that then loads the level based on the index. Another possibility is to have the first selection grid button to be "None" then just ensuring that if the selectionStrings[selectionGridInt] is None don't load the level
(comments are locked)
|
|
You could also set the selectionGridInt in Start() to a value higher than your max. buttons. Something like this:
(comments are locked)
|
|
I think you can initialize selectionGridInt to -1 in Start(). Then add an if(selectionGridInt > -1) to load your level :)
(comments are locked)
|
