So I have a project in Unity that is supposed to be able to load and instantiate classes from an assembly exported from another program. It goes like this:
- Necessary files are exported as DLL from Unity project
- Other program loads this DLL and uses it to make a new class (i.e. calling methods in the original Unity app), which it then compiles to another DLL
- Original Unity app loads this DLL and runs the newly created class
However, when I get to step 3, its like functions in the original Unity project are duplicated and I get conflicts. I guess this makes sense because when you compile the DLL it has to resolve all references.
I then tried doing it so the original Unity project would take the code generated by the other program (text, as opposed to the dll) and compile it at runtime. This worked on Windows, but the problem is that this is an Android app and when I build to the phone, I get the following exception using CSharpCodeProvider to compile:
2019/08/29 14:40:45.424 20040 20069 Error Unity DirectoryNotFoundException: Could not find a part of the path "/tmp/a6icqx2c.tmp".
2019/08/29 14:40:45.424 20040 20069 Error Unity at System.IO.FileStream..ctor (System.String path, System.IO.FileMode mode, System.IO.FileAccess access, System.IO.FileShare share, System.Int32 bufferSize, System.Boolean anonymous, System.IO.FileOptions options) [0x00164] in <7d97106330684add86d080ecf65bfe69>:0
2019/08/29 14:40:45.424 20040 20069 Error Unity at System.IO.FileStream..ctor (System.String path, System.IO.FileMode mode, System.IO.FileAccess access, System.IO.FileShare share, System.Int32 bufferSize, System.Boolean isAsync, System.Boolean anonymous) [0x00000] in <7d97106330684add86d080ecf65bfe69>:0
2019/08/29 14:40:45.424 20040 20069 Error Unity at System.IO.FileStream..ctor (System.String path, System.IO.FileMode mode, System.IO.FileAccess access) [0x00000] in <7d97106330684add86d080ecf65bfe69>:0
2019/08/29 14:40:45.424 20040 20069 Error Unity at (wrapper remoting-invoke-with-check) System.IO.FileStream..ctor(string,System.IO.FileMode,System.IO.FileAccess)
2019/08/29 14:40:45.424 20040 20069 Error Unity at System.CodeDom.Compiler.TempFileCollection.EnsureTempNameCreated () [0x00076] in <0079a30f96a047348857e1cecc6c638a>:0
2019/08/29 14:40:45.424 20040 20069 Error Unity at System.Co
Unfortunately, the rest is cut off. I tried using Roslyn and got a DirectoryNotFoundException as well. Does anyone know either how I can fix this exception, or make the DLL file in the other app so that it will call the methods correctly in the original app?
Aucun commentaire:
Enregistrer un commentaire