By ThomasFlyvholm
on Thu, 11/14/2013 - 17:47
Hi all,
I was thinking if it's possible to have the .json-file fetch a prefab from a designated URL and drop this into the rendered scene, upon the assigned image-target. If this is possible, wouldn't I be able to basically create an application, which after it's initial Google Play and AppStore release, could be updated with new targets and completely new content, without having to actually update the binary?
So basically, what I'm asking is, if this is possible:- Scan an image
- Fetch the metadata from that image
- Fetch the .json-file, assigned inside the metadata
- Connect to a specific URL, assigned inside the .json-file, and download a Unity .prefab
- Place the prefab inside the rendered scene, on top of the image-targetAny suggestions?
Loading prefabs through .json-files
Yes. You can accomplish that using Unity AssetBundles - http://docs.unity3d.com/Documentation/Manual/AssetBundlesIntro.html
Loading prefabs through .json-files
Thank you for the fast response.
Loading prefabs through .json-files
Yes you can exclude the JSON file completely.
Loading prefabs through .json-files
Okay, I'm on my phone atm, but I'll try just to put it easily understandable.
In the sample code, under this specific section:
Loading prefabs through .json-files
Yes, you've got it. Though you might want to implement the asset loading in a seperate script component, and call that via GetComponent<classname>() to free up you event handler to catch new search results, in case the download hangs or the user wants to search on another target.
Loading prefabs through .json-files
Good idea - thank you :)
I'll look properly into it when I get back infront of my computer, and find a suitable structure for it. Again, thank you for the support!