I have an item generator script that creates random items, but I got to thinking ‘why would a rat have a breastplate and where would he keep it?’
What would you find on a feral dog? A great sword? 200 gold?
That’s silly.
So I thought about setting up an array on the mob class to tell the item generator what items to pick from. But there are icons, tooltips to consider also.
Any thoughts out there in programming land?
Thanks!
Have a central singleton instance of a class that contains all of the descriptions, models, tooltips etc and use a Dictionary<string,WhateverYourObjectClassIs> to hold them at runtime with the key being the name of the item(you have to populate this from a List or an array as the game starts as Unity cannot serialize Dictionaries). Then each of your Mobs has a list of strings that are the names of the things it can carry - choose one at random and look it up from the central store.