- Home /
Can I distribute Unity's DLL with an open source project?
I am developing a soon-to-be non-commercial open source project that has some dependencies on some Unity dlls (UnityEngine.CoreModule.dll, UnityEditor.dll, etc.). The project is developed outside of a Unity project and so, in order to resolve the Unity dependencies, I make local copies of the Unity dlls next to the project and reference them relatively (referencing the dlls directly in "Program Files/Unity/Hub/Unity2018.x.x/etc." is not a viable option).
This means that when the project goes open source, the dlls would be included on GitHub in order to allow contributors to easily setup their development environment. I was wondering if there were license issues associated with this practice and if so, how do I mitigate those issues?
Note that the project is looking to be MIT licensed.
Thanks.
maybe if peoples still have a copy of unity engine on their pc and you’re only referencing the dlls, i guess your good to go. https://blogs.unity3d.com/2018/03/26/releasing-the-unity-c-source-code/
but i would say if you attach the dlls, it’s against the unity idea of open source..
Thanks for the link. It sure gives me hints on what the Unity policy is on the subject.
I don't $$anonymous$$d requiring users to have a version of Unity installed on their machine since this project doesn't make any sense without Unity but I don't want to be referencing dlls directly in the Unity installation folder since this path is not reliable between different environments.
I guess that if I have a reliable way to resolve Unity's installation folder (without using Unity's API) I could copy the required dlls to the project local folder.
have you tried to ask unity personaly over mail?
Answer by Bunny83 · Dec 20, 2018 at 09:05 PM
No, you can not. The UnityEngine.dll and other modules are part of the Unity engine. They can be distributed with a game build with the Unity engine. You are no allowed to use of distribute parts of the engine outside a Unity project.
Apart from that most things you find inside the UnityEngine.dll requires the native core of the Unity engine as many parts of the UnityEngine.dll are just wrapper classes which refer to externally defined methods. This is not only true for the various component classes but also parts of the strucs (like Vector2/3/4, Matrix4x4, Quaternion, ...).
I don't think there's anything inside the UnityEngine.dll that would be worth using outside of Unity. If it's something simple it's probably easier to implement the functionality yourself. If it's more complex it most likely depends on the engine core anyways. What exatly are you using from those assemblies?
I wanted to use its JsonUtility class, but sadly the dll's dont work outside of Unity, also your not aloud to do it.
Answer by Magicolo_Land · Dec 21, 2018 at 04:38 PM
Thank you for the precision. Your first point makes it very clear.
As for the second point, I am very well aware that Unity dlls require the underlying engine to be running and since the project I am developing is meant to be used with a running instance of Unity, this should not be an issue. I mainly need to reference the dlls to get the project to compile and so in the compiled project, Unity's dlls are not required. Sorry if was not clear enough, but I need the dlls only when developing the project but since the project is soon-to-be open sourced, I want the whole development setup to be publicly available, including project-local copies of Unity's dlls (to get the project compiling).
Since distributing the copies of Unity's dlls is not possible, what would be the preferred way (that would work cross-platform) of retrieving them from an existing Unity installation? Note that I'd rather have a solution that doesn't require Unity to be running such that one can open the project in 'Visual Studio', hit compile and all dlls should be resolved. If nothing else works, I will require users to lauch Unity and I will use 'EditorApplication.applicationPath' to retrieve the dlls.
Your answer
Follow this Question
Related Questions
Empty Android Build contains more dlls. 0 Answers
Why can't I build Web Player in Unity while I have no problems with building standalone versions? 2 Answers
Add private github Dll as a dependency in Unity. (Working with Dependabot?) 0 Answers
How to work around github with paid asset store assets? 0 Answers
Prefabs not finding MonoBehaviours moved into a plugin DLL 1 Answer