c++ - How to use Mono to script with C# in a Game Environment -
In short, how does the scripting for games play with mono?
Is it the idea that you compile all the scripts in one assembly and then load it and run the script from this assembly? If so, how does a switch assemblage after running a compilation.
I currently have an assembly which is filled and runs at the interv level of the engine. It opens an assembly that compiles all the scripts in the "script /" directory. This then compiles them all into a new assembly called "script.dll". My problem is how to reach this new assembly and be able to call an init / update / rendere function from the engine.
Currently, I do this:
bool scripting engine :: Init () {std :: cout & lt; & Lt; "" & Lt; & Lt; Std :: endl; Mono_set_dirs (Pathuite :: Gateilb Directory (.). C_str (), Pathutil :: GetConfig Directory () .c_str ()); Domain = mon_gate_init ("system"); Assembly = mono_domain_company_app (domain, "../build/Resources/Scripts/2.0/ScriptLoader.exe"); If (! Assembly) {std :: cout & lt; & Lt; "Scripting failed" & lt; & Lt; Std :: endl; return false; } Image = mon_sampus_gate_image (assembly); Mono_git_xac (domain, assembly, RGC, RGR); Scripting class class1 = scripting_cut class ("script manager", "scriptwriter"); Scripting_ call (class1, "loadqu"); Std :: cout & lt; & Lt; "" & Lt; & Lt; Std :: endl; Back true; }
Now, how will I do this to reach this new Assembly? I do not see anything about loading multiple assemblies in the document or support of mono, I need to be able to load the assembly and call the function from any script. Is this the right way to do this?
Comments
Post a Comment