UnityEngine.UI outside of Unity Environment - unity3d

I am trying to compile several scripts in my project into an easier to move and manage DLL file, however several scripts call UnityEngine.UI, and I know that the DLL file used to exist in /Contents/UnityExtensions/Unity/GUISystem/Editor/UnityEditor.UI.dll however the only data I can find for it now are the uncompiled files inside the Package Manager, where is the compiled DLL stored now?

The simplest answer that I just found is to look in the project folder of one of your projects in Library\ScriptAssemblies

Related

Adding external project to unity solution

I am trying to add an external project to my unity solution.
It works fine using mono develop but whenever I switch back to unity it seems to remove the reference from the solution.
Is there a way to prevent unity from doing this ?
Thanks,
Unity rebuilds (i.e., removes the existing file and build it again from scratch) MyProject.sln file whenever it finds changes from ~/Assets folder. As such, any manual modification done by you or outside Unity's automated process on MyProject.sln will be discarded each time Unity compiles.
As #Kamalen mentioned, the usual way to import an external project is to have the external project be a library project, build *.dll from it, and put the *.dll file somewhere under ~/Assets. When there are *.dll files under ~/Assets, you have a reference to the classes and methods defined in the library file from any code you put under ~/Assets.
However, it seems that you have the access to the source code and tend to modify the external project often from your comment.
In that case, you could consider putting the source code of the external project under ~/Assets. The folder structure would then look like:
MyProject/
MyProject/MyProject.sln // this is rebuilt again each time by Unity
MyProject/Assets/
MyProject/Assets/ExternalProject/... // This could be a git submodule
MyProject/Assets/scripts/...
You can of course have the ExternalProject be a git submodule and maintain it as a separate git repo. Then you can either make changes to the ExternalProject from inside Untiy folder, or the original location of ExternalProject and then sync the ExternalProject under Unity folder with a pull from git.
As a rule of thumb, import *.dll files if you know the library is complete and it is unlikely to have changes in the library project, which includes the case when you do not have access to its source code. When there exist *.dll files in a project, it's common to assume the library is complete, unlikely to change, and outside of our control, and hence it's called an external project.
Your best way to have an external project into Unity is to... not have an external project directly. Unity does rebuild the solution file regulary and is almost like a temporary file.
What you can do is configure your external project as a library project, and configure the project (or an external tool) to output the generated DLL in any subfolder of the Assets folder.
If your external project uses Unity classes, it will need to have references to UnityEngine.dll and UnityEditor.dll, located in folders :
Applications/Unity.app/Contents/Frameworks/Managed/UnityEngine.dll for Mac
Program Files\Unity\Editor\Data\Managed\UnityEngine.dll for Windows

How can I use folders in a Swift application compiled from the command line?

I'm building a simple webserver using Swift3 and the Swift Package Manager. Running swift build in your project folder will build all of the sources found in the Sources directory and output an executable. However, I've found that if I create folders within the Sources directory to organize my code, my builds fail. It looks to me like the presence of folders causes swift to treat the source as different modules. Is this the cause, and if so, how can I work around it?
Yes. Putting directories directly under Sources will cause SwiftPM to interpret those as modules. This is described in the package manager reference.
To work around this, use another level of indirection: put a directory for your module inside Sources and your additional directories inside that directory:
Sources/YourApp/Stuff/Source1.swift
Sources/YourApp/Stuff/Source2.swift
Sources/YourApp/MoreStuff/Source3.swift
Sources/YourApp/MoreStuff/Source4.swift

Distribute Dart framework outside of package directory as project template

I'm trying to create a Dart backend framework that developers can download as a dependancy and have the basic folder structure, Dart files and such generated for them in their own project. From what I understand, downloading a dependancy package only places files inside the package directory/ies (although, I may be wrong).
To get around this, I believe Dart can be used like a Bash script, and can place files in the project directory automatically through running the package's bin files in the terminal (illustrated in the Running a script in a dependency https://www.dartlang.org/tools/pub/cmd/pub-run.html).
Would this be the best way to achieve the desired result? Or is there an easier way to download a framework as a project template? (I'd also like to place similar scripts for generating controllers and such in the tools directory, and don't know if keeping this framework as a dependancy would be necessary after 'install').
Thank you for reading.
You can use pub global activate some_package to be able to use pub global run some_package:some_script or just some_script to allow to run a script contained in a Dart package without adding it to the dependencies.
I think this is the best way to distribute it.

Is it possible to create a unity3d package using files from outside my project?

In most examples I see the paths to the files are relative ("Assets/Models/monster.fbx"), and this seems to work fine. But is it possible to have a file from outside my project included in a package? ("/Users/angrymonkey/Documents/dragon.fbx")
I'm doing this by code btw, not from the IDE. So I want to refer to files outside my current project from code.

How to compile Unity3D script to include it to AssetBundle?

According to this manual I can include scripts as binary data and load them via Reflection. I understand all steps, except one: how can I compile script to get binary data for stroring it in .binary file? Is there any tutorial/help?
UPD:
Actual question can be restated as: "How can I compile single file with MonoDevelop and get its bytecode"
Solution:
Open Monodevelop and create C#Library project
Add UnityEngine.dll to References
Compile your scripts
Copy bin/.dll from your library project folder to Assets of your unity project and change extension from .dll to .bytes
That's all.