I’ve always had a tendency to try to automate and improve the processes I have to perform.
This is also how I ended up realizing that I had a taste for programming, and that I changed path, moving away from a career in human resources.
As examples, in my web development agency, I participated in improving and maintaining several custom tools :
- Initialize the configuration of a type of content (fields and their properties, form, etc.) by reading an excel file rather than manually executing everything with dozens of clics.
- A website to track our other websites (those of customers), and to alert us when security breaches are published, and to know which ones are concerned.
If there’s one thing I could fault the Unity engine for, it’s its interface. In particular to handle somewhat complex data. More specifically nested arrays, list, data structure, etc.
For example, in the RPG demo we have a Conditions system. A dialogue will only be accessible if certain conditions are met, a piece of equipment will be equipped under certain conditions, etc. Here is what the inspector gives us to set a condition.
It is quite frustrating to use, and to have (re)write the string for the parameters (like the objectives for a specific quest) is highly prone to typos. And any typo will cause not a crash, but a silent error. Quite difficult to design with and also to debug.
You have to select the quest, select the objective, copy it, and navigate in the folders to find the dialogue, and finally past the copied objective. Or for the Predicate type “HasItem”, you will have to write the UUID of the item.
So with two custom PropertyDrawners here is the result :
No need to write anything anymore. For the code it is the two file below :
Now for the custom EditorWindow, I made one for the Items. We have one abstract class InventoryItem, herited by several others (Weapons, Abilities, Consumables, etc).
A custom Inspector give more flexibility, and also the opportunity to display a preview of the toolpip that will spawn when the player hover the icon of the item. Here is some examples, with the custom EditorWindow on the left, and the default Inspector on the right.
But I have heard a lot about the Odin Inspector, and it seems the perfect tool for this kind of job. I will give it a try, and see if it is possible to have a EditorWindow for ALL the items (instead of navigating through the folders).