Hi,
Thanks SebasLive for your input, very valuable.
indeed, I have sometimes 4 5 arrays on a single GameObject because I have this kind of sorting to do ( doing a game of chess atm, and I want to know each square, where each pieces are, etc etc, and I need a lot of arrays to support all my various ways to access this data relations).
so indeed, if you create a unique string id for each of your items, you can have for example:
1: hashtable reference each GameObject in relation with their unique Key.
2: Several arrays, listing keys in orders, one array could list them by price, another by name, etc
3: each GameObject MUST have a fsm which will host its unique Key, so that you can access data from anywhere, the GameObject should be able to find itself inthese various arrays.
4: then everytime you have a new item, you can call routines in various fsm to go trhough the hashtable ( containing ALL), and then parse and populate/sort/add/remove keys in various arrayLists.
The other way is DataXml. if you use Xml and xPath, you can sort right within your xpath query, never tried it, but I think it should work, and would be UTTERLY efficient indeed cause you would simply need to maintain this xml and save it in playerprefs to keep your user game status over time.
http://www.developer.com/xml/article.php/1560361/How-to-use-XPath-and-Sorting-in-XML.htm Bye,
Jean