question

gergelysebestyen avatar image
gergelysebestyen asked

How to get a single row from PlayerData?

As the tutorial shows i filled my dictionary with some string variables

Data = new Dictionary<string, string>(){

                {key1, value1},

                {key2, value2}

            }

But in the tutorial with foreach load all the data from result.Data. Like this:

foreach (var item in result.Data)

                {

                    Debug.Log("    " + item.Key + " == " + item.Value.Value);

                }

So, how can i get just the key1 and value1?

Thanks for the replies!

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

·
brendan avatar image
brendan answered

Could you let us know a) the specifics of the calls you're making to write and read the data (specifically, is this a JSON object you're writing to a single key/value pair?), and b) what the scenario is? Normally, you would read one or more key/value pairs and then parse the data for use. So to use the key1/value1 info, you would look through the returned data for it. Alternately, if each key/value pair is distinct in user data, you could just read only key1 from the user's data.

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.