I do a lot of work in an external project, and it would be great to refer to AStar’s types in that external project. Is it possible to compile everything into a DLL? If so, is there a guide to do so?
Thank you.
I do a lot of work in an external project, and it would be great to refer to AStar’s types in that external project. Is it possible to compile everything into a DLL? If so, is there a guide to do so?
Thank you.
Hi
Sorry, right now there is no support for that.
I guess you could compile it to a dll yourself by just bringing the sources into a monodevelop project and compile it.
Can I put in a feature request for that? We’d go pro for that capability alone.
I do have an old script I used at one point to export dlls, but I haven’t used it in a while.
It is possible that I could get it to work.
Hm…
I think I have managed to get my old script to work.
I have uploaded a new hidden version.
If you have the pro version, enter your invoice number on the download page. Copy the link to one of the downloads. It will say something like “…//isometric_Pro” change that to “…//master_Pro_dll”. Then access the url.
That will bring you a unitypackage which includes a dll file and the necessary editor assets. It is currently build without iphone or windows phone support and is targeted at Unity 4.5+.
Sorry to bump an old topic, but would you reconsider publishing DLL versions? It’s great being able to look through source code, but unfortunately the only good way to run a larger Unity project is to have as many plugins/assets precompiled as possible.
Otherwise, I tried converting the current version to a DLL myself using Visual Studio and it kind of succeeded, but the custom inspectors break with the error “Can’t load custom inspector because the inspected type is null”. I’ve been examining this hidden DLL version and I can’t figure out if you did anything to solve this. Would you have any tips? Thanks!
[EDIT] I just tested another much smaller asset that had the same problem using MonoDevelop to create the DLL instead of Visual Studio and it worked! I’ll try it with AStar tomorrow and report back. Might not need to bother you
Yep, looks like my mistake was using Visual Studio. I had to download the current version of Xamarin Studio, and then follow typical instructions for building a DLL, selecting Mono / .NET 3.5 as the target framework. Interesting that neither Visual Studio or the version of MonoDevelop supplied with Unity work, only a later version of MonoDevelop or XamarinStudio works. So nevermind, thanks for all your work and keep going!
Hi
Great that you managed to solve it
Yeah, I really should make dll versions available. It just takes some time getting the scripts to export it correctly.
Hi Aron, I’m having an issue when I try to compile my code into a separate DLL while keeping your project as code in Unity. I have simplified the issue as much as possible in this zipped file:
http://colony-games.com/images/tester.rar
I’ve done this same solution with the 2D Toolkit, DialogueSystem, and NGUI. All works fine. It only throws this error when I attempt it with A* Pathfinding Project:
Unhandled Exception: System.Reflection.ReflectionTypeLoadException: The classes in the module cannot be loaded.
at (wrapper managed-to-native) System.Reflection.Assembly:GetTypes (bool)
at System.Reflection.Assembly.GetTypes () [0x00000] in :0
at Mono.CSharp.RootNamespace.ComputeNamespaces (System.Reflection.Assembly assembly, System.Type extensionType) [0x00000] in :0
at Mono.CSharp.RootNamespace.ComputeNamespace (Mono.CSharp.CompilerContext ctx, System.Type extensionType) [0x00000] in :0
at Mono.CSharp.GlobalRootNamespace.ComputeNamespaces (Mono.CSharp.CompilerContext ctx) [0x00000] in :0
at Mono.CSharp.Driver.LoadReferences () [0x00000] in :0
at Mono.CSharp.Driver.Compile () [0x00000] in :0
at Mono.CSharp.Driver.Main (System.String[] args) [0x00000] in :0
I was wondering what your thoughts are. Thank you for your assistance. If we find a good solution, I’ll purchase A* Pathfinding Project shortly. This is my only hangup. And since this is a larger project, putting my code into Unity is not feasible. You will notice that if you comment out the Seeker line in my test project and recompile, it’ll work fine. It only fails when you add Seeker or perhaps some other A* object.
I’ve narrowed it down. It’s a Unity glitch.
Unity blows up when I include an assembly that references Assembly-CSharp.dll (needed to access A*), uses one of Assembly-CSharp’s classes, and has an extension method of any type.
The best fix would be to have A* in a DLL, thus not needing the reference to Assembly-CSharp.dll. Aron, are you creating DLL’s for each of your updates? If so, I’ll purchase the Pro edition.
Hi
I went back to my old dll exporting script and updated it to work. So now I can actually export dlls.
I can send you one if you want.