In my previous 3dengine I actually integrated a scripting language which dynamically loaded meshes in and out of mem + other assets.
Now it would be nice if I could load in custom javascripts too.
So, is it possible somehow to load an extra javascript file into my project and for example call its init() function ?
Most important would be to know if it can be done, and secondly (if it can be done) how to do it
I’ll lookup on eval, but I actually meant to be able to load for example a complete 800-lines long .js file an then atach it in code to a dummy gameobject whereafter I can call its init() function.
I don’t think that’s possible…the code is compiled, not interpreted, and there’s no such functionality to compile code with the runtime. However, you could write your own scripting language in Unity.