Hi guys,
I’ve been reading up a lot on Unity3D. Although I have a strong web development (PHP, MySQL, JS) background I chose to go with Unity C# instead of Javascript due to my dream project possibly requiring use of a third-party network suite that supports Unity3D.
I’ve been playing with Arrays/Collections for the last two days almost full-time and I’m up to speed with how to work with them for the most part. However, I’m a little uncertain about some concepts especially multidimensional collections. Its likely I’m at a disadvantage owing to my non-programmer background and being spoiled by the flexibility of PHP arrays.
Following is what I came up with. However, is that the right way to go about it? All I know is I want a string INDEX and the value needs to be of any type.
Dictionary<string, Hashtable> myPlayer = new Dictionary<string, Hashtable>();
myPlayer["DATA"] = new Hashtable();
myPlayer["DATA"]["Health"] = 100;
myPlayer["DATA"]["Mana"] = 100;
myPlayer["DATA"]["Speed"] = 6;
myPlayer["DATA"]["Gold"] = 70;
myPlayer["CUSTOM"] = new Hashtable();
myPlayer["CUSTOM"]["Gender"] = "Female";
myPlayer["CUSTOM"]["Style"] = "Gamma_H03";
myPlayer["CUSTOM"]["Face"] = 1;
myPlayer["CUSTOM"]["Body"] = "Medium";
myPlayer["CUSTOM"]["Suit"] = "Alpha_S01";
myPlayer["ITEMS"] = new Hashtable();
myPlayer["ITEMS"]["Potions"] = 5;
myPlayer["ITEMS"]["Food"] = 10;
myPlayer["ITEMS"]["Bolts"] = 20;
myPlayer["ITEMS"]["Stones"] = 3;
myPlayer["WEAPONS"] = new Hashtable();
myPlayer["WEAPONS"]["Range"] = "Crossbow";
myPlayer["WEAPONS"]["Surround"] = "Bomb";
myPlayer["WEAPONS"]["Combat"] = "Knife";
What is the best practice to store and retrieve character information in a massive RPG with heavy character customizations and such like the above?