javascript - Add script to assetbundle in HTML -


i'm working on project uses unity webgl display different machines/parts/.. in 3d, these parts or machines selected user , loaded scene (for there single scene, might want load scenes dynamically also).

because of large amount of choices want create different asset bundles, containing 1 or more parts each, can download these on-demand.

i've done passing url loadfromcacheordownload , extracting gameobject www object.

now include scripts assets create animations , user interaction. followed explanation given here: docs.unity3d link, , this works in webplayer. end requirement webgl, , same code built webgl gives following error:

notsupportedexception: /users/builduser/buildslave/unity/build/tools/il2cpp/il2cpp/libil2cpp/icalls/mscorlib/system/appdomain.cpp(184) : unsupported internal call il2cpp:appdomain::loadassemblyraw - "this icall not supported il2cpp." system.appdomain.loadassemblyraw (system.byte[] rawassembly, system.byte[] rawsymbolstore, system.security.policy.evidence securityevidence, boolean refonly) system.appdomain.load (system.byte[] rawassembly, system.byte[] rawsymbolstore, system.security.policy.evidence securityevidence, boolean refonly) system.appdomain.load (system.byte[] rawassembly, system.byte[] rawsymbolstore, system.security.policy.evidence securityevidence) system.appdomain.load (system.byte[] rawassembly) system.reflection.assembly.load (system.byte[] rawassembly) api+c__iterator0.movenext ()

it seems stem call system.reflection.assembly.load(txt.bytes); (which got example), suppose reflection class not (yet?) supported webgl. can't seem find documentation on this.

is there way around using reflection this? @ best i'm hoping different code can fix this, @ worst have create scripts webgl in javascript , add them such instead of binary? i'm bit lost here leads appreciated.

(cross-posted answers.unity3d)

no, there no way around restriction reflection.

the key difference between web player , webgl build targets in unity in case webgl uses aot (ahead-of-time) compilation, whereas web player uses jit (just-in-time) compilation. aot compilation, not possible load assembly @ run-time not present @ compile time.

of course, possible load javascript code @ runtime, suggest, you'll need go route.


Comments

Popular posts from this blog

angularjs - ADAL JS Angular- WebAPI add a new role claim to the token -

php - CakePHP HttpSockets send array of paramms -

node.js - Using Node without global install -