x


Best way to load information from server?

What is the best way to load information mapped to a Game Object from a server? Objects in my game will have extra data and information attached to them but this information will be on a server and fetched at run time via the use of asset bundles if they're needed. As far as I'm aware asset bundles can not contain scripts so how do I do this?

To further elaborate, the player will walk up to an object and upon selecting it, an asset bundle is downloaded and the information about the object displayed.

It needs to be done this way as I'm developing for the iPhone/ iPad so don't want to waste memory on having information preloaded when it might not be needed.

Any advice would help, thanks.

more ▼

asked Jan 17 '12 at 03:11 AM

unity200 gravatar image

unity200
16 9 10 12

Woah, I'll just lay out my thought. Well if you're doing this to save weight, its the models, audios and textures that you want to strip out of the main build, not scripts. Finally the base idea is probably to use WWW to download AssetBundles containing your models and assets. Then add the scripts already in the main build using AddComponent(). Finally get your new models data either as .txt inside the AssetBundles or download it using WWW/WWWForm and some WebPortal/SQL. Note that all that takes time and should be initiated before the player actually needs it.

Jan 17 '12 at 03:34 AM by0log1c

Thank you. That seems very helpful and is exactly what I'm look for. I'll give it a go and see what happens.

If it's not too much trouble could you elaborate on how exactly to load the data using WWW/WWWForm. I've read their references but am still not sure exactly how to proceed here.

Jan 17 '12 at 08:32 PM unity200
(comments are locked)
10|3000 characters needed characters left

0 answers: sort voted first
Be the first one to answer this question
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:

x1999
x413
x382
x360
x195

asked: Jan 17 '12 at 03:11 AM

Seen: 645 times

Last Updated: Jan 17 '12 at 09:51 PM