- Home /
Export compiled project file at runtime?
Hey,
I've been working on a block editor for the Unity game Besiege. One user on the forum provided a code interface to allow users to create their own blocks and items in-game. It works and is widely used, though I intend to develop an interface for it. When being used the user has to enter their own values in the code and compile it to its .cs file. The interface is nearly done, and I have his code in Unity, I just plug in my variables and his code would compile and run fine in the game, however, I need to export this compiled .cs file after the user has input their information at runtime. This would be an instance of the file that has been modified at runtime.
Is there any way to extract this instanced code file at runtime, with the variables influencing their values in the script?
A different acceptable method would be to have the code in a string and compile that into a file at runtime. Are either possible?
Note: Modding this game is acknowledged and encouraged by the developers.
When you say "export compiled project file" you mean create a build? $$anonymous$$aking the build is a feature of the Unity Editor, you can't create a new project at runtime as part of your game,
Unity supports AssetBundles. An asset bundle can contain scripts (not on iOS) so you can add any mod that way, but I don't think you can make an AssetBundle at runtime either, it's also a feature of the Unity Editor.
I meant that I wanted to export a script that was built into the stand-alone version of the game as a dll file. I should have really said exactly that...
Your answer

Follow this Question
Related Questions
Multiple Cars not working 1 Answer
Distribute terrain in zones 3 Answers
Laying Traps and Snapping to surface 1 Answer
How can I take a picture of 3d Moddel at Runtime 1 Answer
Edit Terrain at runtime 1 Answer