Question about creating scripts, I/O and compiling

I’m currently trying to figure out if this setup is viable in Unity or if it will require a Pro license.

Basically what I want to do is make use of normal I/O for text files. Reading the text asset reference makes it look like basic text I/O won’t be a problem at runtime.

After the text files are read I want to generate a new script object and plug that text into the script object so the new script can be applied to an object ingame.

Basically students write a script, drop it into the folder and it shows up ingame.

This reference says

This page talks about Unity generating new scripts itself. I was hoping to use that functionality to build new scripts at runtime and input the text from the external files.

I’m basically trying to figure out how scripts work at runtime. If this would work as is or might require some creative workarounds to get the scripts to load.

Students will need to try their scripts, make changes and test it out on their own time. Giving them the project file to rebuild themselves won’t be an option.

Unity does not support script addition at runtime.

They are compiled by the editor on the fly to .NET assemblies that then are used by the application

So that basically leaves building the scripts into asset bundles and using the pro version to push those out to clients?

I’m interested in knowing this as well. We have the indie version and we are having issues with scripts that we built not building in our .exe file so it doesn’t see any of the commands we assigned.

.NET has some built in compiler features (I assume Unity uses these) you might be able to take advantage of those (and if you like somehow reference in the MonoBehavior class) this is assuming Mono supports this… just a suggestion of a place to start.

You can use eval() in Javascript to add and run code at runtime.

–Eric