Hi there!
First of all, my IDE is based on Unity 3.5.7 pro + ios pro + android pro (can’t upgrade right now
not enough money).
Now, I’m parsing an XML document where I have several data, and I store everything inside a big dictionary with several sub-dictionaries, this is the structure:
GAMES
--GAME key:"game01" value: object_dictionary_game
----LEVEL key: "level01" value: object_dictionary_level
------NAME key:"name" value:"my_level_01"
------LEVEL_OPTIONS key: "option01" value: options_dictionary_option
------LEVEL_OPTIONS key: "option02" value: options_dictionary_option
------LEVEL_OPTIONS key: "option03" value: options_dictionary_option
----LEVEL key: "level02" value: object_dictionary_level
------NAME key:"name" value:"my_level_02"
------LEVEL_OPTIONS key: "option01" value: options_dictionary_option
------LEVEL_OPTIONS key: "option02" value: options_dictionary_option
------LEVEL_OPTIONS key: "option03" value: options_dictionary_option
--GAME key:"game02" value: object_dictionary_game
----LEVEL key: "level01" value: object_dictionary_level
------NAME key:"name" value:"my_level_01"
------LEVEL_OPTIONS key: "option01" value: options_dictionary_option
------LEVEL_OPTIONS key: "option02" value: options_dictionary_option
------LEVEL_OPTIONS key: "option03" value: options_dictionary_option
----LEVEL key: "level02" value: object_dictionary_level
------NAME key:"name" value:"my_level_02"
------LEVEL_OPTIONS key: "option01" value: options_dictionary_option
------LEVEL_OPTIONS key: "option02" value: options_dictionary_option
------LEVEL_OPTIONS key: "option03" value: options_dictionary_option
--GAME key:"game03" value: object_dictionary_game
----LEVEL key: "level01" value: object_dictionary_level
------NAME key:"name" value:"my_level_01"
------LEVEL_OPTIONS key: "option01" value: options_dictionary_option
------LEVEL_OPTIONS key: "option02" value: options_dictionary_option
------LEVEL_OPTIONS key: "option03" value: options_dictionary_option
----LEVEL key: "level02" value: object_dictionary_level
------NAME key:"name" value:"my_level_02"
------LEVEL_OPTIONS key: "option01" value: options_dictionary_option
------LEVEL_OPTIONS key: "option02" value: options_dictionary_option
------LEVEL_OPTIONS key: "option03" value: options_dictionary_option
Inside a GAME, a LEVEL and LEVEL OPTIONS there are several individual options, but apart those “nodes” I put there are also dictionaries, of course there are several games, levels and options, I hope I’m explaining this enough.
So far so good, the thing comes when I want to access those dictionaries, it should be easy, but I want to be able to list all the games that exists inside a dictionary, I want this in the console, but probably I’ll be using this in the future in the UI or something like that.
For example something like:
Dictionary GAMES
GAME01:object_dictionary_game
GAME02:object_dictionary_game
GAME03:object_dictionary_game
Of course I also want to list levels and options, for example:
Dictionary GAMES_GAME01
LEVEL01:object_dictionary_level
LEVEL02:object_dictionary_level
Dictionary GAMES_GAME01_LEVEL01
NAME:"my level 01"
OPTION01:object_dictionary_option
OPTION02:object_dictionary_option
OPTION03:object_dictionary_option
I hope my explanation is clear, so far I construc mi dictionaries using:
Dictionary<string,object> games = new Dictionary<string, object> ();
I think I know how to extract the data from the object and convert it to a boolean, and int or a string (which is what I need).
I know also how to get the count of “nodes”, for example GAMES.count would return 3, but I want to know the identifiers, the keys of those 3.
In the end I just need how to use the dictionaries to retrieve their data, i’ve looked into the MSDN library, but it is not too clear to me ![]()
Hope someone can help.
Cheers.