- Home /
Help with a custom inspector field.
Okay, so here's my issue. I'm working on a shopping simulation where customers enter a store and pick products from a shopping list from various shelves. I already have Shelf components being added to gameObjects that act as tiles in a 2d grid. My problem, is that I would like to have a Product field in the Shelf script that accepts a single item, that the shelf can then read info from (such as shelf capacity, price, onSale, etc). Note: I do not need the Products to have MonoBehaviour functionality, just the ability to hold editable data.
Ideally, I'd like the inspector to do something like:
Product [ BlueBox (Product) ]
I've gotten it to work by adding a custom serializable class, but I'd like to be able to use a set of predefined Products, without having to worry that the BlueBox on one shelf is different from the BlueBox on another.
There may be a painfully simple solution that I'm completely overlooking. Either way, any help would be much appreciated!