Thursday, November 20, 2014

Editor Plugins!



Rather than laying out all our scenes by hand, I wrote a plugin for Unity that allows us to take in a description of the level and then places everything correctly. The level file describes things like the width and height of the level, the tile sheet for the ground, where players and enemies are, and more. Then, we provide the plugin with this file, the sprite sheet, some other dimensions and the scene that will follow the scene we are generating. Then, we press the button and get a scene with everything setup the way our scripts require.

This is what results from generating the map from the picture above:






The level is generated (which saves us from having to do it at runtime), all players are placed with their correct stats; likewise for the enemies and their stats and AI. The terrain and status objects are also added to their correct position to influence the way the map plays out. All in all, this just makes it much easier to setup a scene and removes a number of things that we used to do at runtime.

No comments:

Post a Comment