I am trying to create a game with modding ability and i have support for scripts, but they are clean code so I need to execute them. I could import every file, but I can’t write new names to main code’s file and recompile it.
Basically, I just need to import other files (I guess they need to be .exe
instead of .cs
to be compatible with already executed program) and create some instances of them, but how do I do that?
I searched for it and found about DataTable, but it’s only for math. Can I do something with it? Like, in Python, you can easily parse strings like normal code, but how do I do this with C#?
I tried exec function, but couldn’t figure out how to work with that, because it’s returns true/false but don’t creates any classes or something what I need.
Arsenii Shamrin is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
1