Hi there
I just can’t get my head around this:
In reference to this question
Problem is the following:
Say you have a player, that player has an inventory, the inventory has weapons, and those weapons have stats.
Disregarding creating equivalent GameObjects and assigning scripts/values to these and so forth. how would I go about making that player?
I come from pure javascript.
So it could just be:
var player = {};
player.inventory = {};
player.inventory.weapons = {};
player.inventory.weapons["axe"] = {damage = 10, price = 5};
// then we could access the axe price stat with: player.inventory.weapons["axe"].price;
Nested classes, dictionary/hashtable, or is the best way to go to link everything to respective GameObjects
Thanks.