Level Editor Rewrite

Today, I took a game template that I wanted to mess around, and I rewrote the level editor to make levels faster. Before, each level’s attributes are stored in a different game object that can be edited in the inspector. Used to having the object hierarchy on the left and the inspector on the right, it’s not practical for making new levels.

So I did two things 1) Store all level’s attributes right in the LevelManager and the buttons call a function from the LevelManager. The only thing the button does is to inform which level is selected. 2) Generate buttons on the runtime instead of having them on the screen. The benefit is that each button can have unique callback function and it takes a simple for loop to do it.

Pretty happy that the code works and the next part will be reworking the actual game.