- Home /
Is it possible to load a script from a url?
Is it possible to load a script from a url and attach it to a GameObject.
I know you can attach a script to a GameObject use AddComponent(thescriptname);
I also know you can use WWW to get information from a text file located at a url.
but is it possible to combine the two functions to load a script from a url to add it to a GameObject?
Thanks,
Dan
Answer by Bunny83 · Jan 28, 2012 at 07:17 PM
No, the scripts are all compiled into .NET / Mono assemblies (dll-files). If you target a Standalone build (windows / Mac), then you can try using Reflection to dynamically load an external assembly, but you can only implement your own plugin interface. You can't load MonoBehaviour-derived-classes since they aren't registered in the AssetDatabase of your project. For web-builds there's no way at all AFAIK since the security sandbox doesn't allow most reflection stuff that deals with dynamic loading / accessing local files....
Your answer
Follow this Question
Related Questions
Max String Length in WWW url's? 1 Answer
location of file downloaded with WWW 1 Answer
How to assign texture from url 1 Answer
Setting variable as type "Scene" 4 Answers
One material for many objects with different textures 2 Answers