Don't fight your tools, or how I fell down the Unity EditorWindow rabbit hole!

This weekend past was some more "Tactical Limit". It was a decision between starting the network code or creating a way to have levels/arenas. It ended up being the later.

Tactical Limit is a two person strategy game played on a grid (I'll call it an arena). I already had procedurally generated arenas, but wanted to have the ability for pre-designed arenas.

Coming from a web development background I naturally thought JSON should be easy enough: I could easily lay out a JSON text file formatted so it looks like a grid & be easily visualised despite being text. I knew there was some funkiness required to do JSON in Unity, but thought I would go ahead. The recent version of Unity (5.3.1 ATTOW) has introduced some support for JSON, but that's out of the question at this stage because of other bugs in 5.3.1 I don't care to worry about. A look at how some of the third part plugins worked quickly ruled JSON out as a sustainable (or easy) way to reach my goal.

Javascript is a prototypical language, not a classical language, and I've learnt to embrace that prototypical nature and work in harmony (ES6, no pun intended) with the nuances of the language. Makes sense, so why not apply the same lesson to Unity?

I've heard of these ScriptableObject things in Unity before so decided to check it out. Turns out they are great for turning data class structures into assets! Ok, that's cool, it was trivial to make a menu so I can make a data class representing an arena into an asset loadable by my arena instantiation code. That's nice, but it's still hard to visualise what it is supposed to look like!

This is where I fell down the EditorWindow rabbit hole! I decided to check out the extensibility of Unity's editor, Saturday is a fuzzy blur of trawling the documentation & watching quaint little tutorials. Turns out the hardest part was just figuring out the exact GUI controls from the API!

So my result gets the job done, but has opened up a new world for me to tackle with 'gizmos' etc and make my own in scene editing!

Embrace the differences in your tools, and they'll embrace you back! 😀