x


Using a method to get the string from a download.

Hello, I have been trying to create a method that gets the characters names from a user in the data base. I created the method: string charlist(float charc) that gets the characters local id (from 1 to 3). (People can hold only 3 characters with their users). The method gets the information sends the url and checks if the download is done but as long as it runs only once it checks only ones and it doesnt gets me the strings name back. It uses if(WWW.isDone). Is there a way to get an IEnumerator called by coroutine to return back a string? Because it did not work to me.

Please help me out!

more ▼

asked May 07 '12 at 10:34 AM

benk0913 gravatar image

benk0913
98 9 17 23

(comments are locked)
10|3000 characters needed characters left

3 answers: sort voted first

I had problems with this last night and it took me a long time to think about my code. Think logical about your code, Ienumerator's cant return data.

The way I did it was to have a player list. When I called the Ienumerator, I sent 3 variables: AuthCode, Player class instance and url. Once I had fetched the WWW, I accessed another function which took the player class variable and response. This way, you have a reference to which player you want to allocate the information to and also the response data, all in its own little function.

Hope this helps!

more ▼

answered May 07 '12 at 11:01 AM

alexc1995 gravatar image

alexc1995
37 2 3 4

(comments are locked)
10|3000 characters needed characters left

Hmmm. I dont see how this helps.. but thank you anyways. Its propably because we try to achive different goals.

more ▼

answered May 07 '12 at 11:20 AM

benk0913 gravatar image

benk0913
98 9 17 23

(comments are locked)
10|3000 characters needed characters left

Hmmmm... Can you please post the other function that shows grabs the information?

more ▼

answered May 08 '12 at 07:42 PM

benk0913 gravatar image

benk0913
98 9 17 23

(comments are locked)
10|3000 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Topics:

x527
x324
x78
x55
x4

asked: May 07 '12 at 10:34 AM

Seen: 390 times

Last Updated: May 08 '12 at 07:42 PM