How to add library ending with numbers (libXXX.so.1) in Unity3D assets - unity3d

I'm creating a Unity3D application which depends of libraries named as libXXX.so.1
Unity are not bundle them into the assets: I can't select them in the editor and they are just ignored if I put them into the Assets folder.
It's working well if library names are libXXX.so, but renaming breaks the links between libraries.
How to force Unity to include those libraries inside Plugins folders?
I want to create a distribuable unitypackage so I can't just copy them to the output folder after each build.
Source folder:
find . -name "*.so*"
./Assets/Plugins/Linux/libTest1.so
./Assets/Plugins/Linux/libTest2.so.1
Build foder:
find . -name "*.so*"
./Project_Data/Mono/x86_64/libmono.so
./Project_Data/Mono/x86_64/libMonoPosixHelper.so
./Project_Data/Plugins/libTest1.so
./Project_Data/Plugins/x86_64/ScreenSelector.so
./LinuxPlayer.so

Unity3D will include all the files that are in the Assets/Resources folder (and all sub-folders under Assets/Resources). Check out this document page:
https://docs.unity3d.com/ScriptReference/Resources.html

Related

Why Flutter Web Assets folder inside of another assets folder?

I have an assets folder in my project. When I run flutter build web and look into the resulting build, this assets folder is nested inside another automatically generated assets folder. So, now I have to either:
Prepend every asset reference in my code with assets/.
or
Move all my assets up a directory, so instead of the path being assets/assets/asset.jpg, now it will be assets/asset.jpg.
Is there a way for me to stop flutter from nesting my assets folder in another assets folder?

Assets in Flutter package are not visible in the app

I've created a package, which uses some assets (sf2 file, ttf files, etc). Assets don't seem to load. I can fix this by including these files in the assets folder of my main project (so now, every asset in the package is also in my main project). However, when I build a web app, it still creates an extra folder for my package with the files that it needs.
Is there a way around this? How do I enforce the package to use the assets from itself?
After some digging, I've found a way to include it.
'packages/livescore_sdk/assets/default_team_logo.png' works instead of 'assets/default_team_logo.png'
Include the assets in your lib folder, and import it from local project only.
Assuming the project name ABC:
Steps
Create assets folder in lib, example: lib/assets. Full assets example url: ABC/lib/assets/some_asset.png
Copy the assets in this folder.
Import the assets in your pubspec.yaml like this:
assets:
- packages/ABC/assets/some_asset.png
Hope this help someone. :smiley:

Rename files generated during webGL build

I just loaded up a Unity WebGL project that I downloaded from github.
When I build it, all the build files in the obj folder are named like obj.framework.js, obj.data etc...
Is there a way to change obj to something like galaxyEducation.framework.js, galaxyEducation.data etc...?
I looked in Project Settings section of Unity, but couldn't find anything.
Is there a place to set this?
Thanks!
Just in case someone else asks, I found this answer:
The Build folder contains the following files ([ExampleBuild]
represents the name of the target build folder)
On this Unity website: Building and running a WebGL project

NetBeans Include External JAR in Export to Zip

I have a NetBeans project that uses the GSON library. I've tried including the GSON.jar file without requiring future users to separately download it. However it doesn't seem to work. The project looks for the file from the relative path of my computer so the file isn't found on another user's computer. Is there a way to include GSON.jar and "Export to Zip" and keep the reference in the project itself? I'm lost!
Thank you
Exporting a Project to ZIP zips up the project folder only, and not anything outside of the folder, including dependencies. If you include the GSON.jar file in the project folder, then the JAR file will be included in the .ZIP file. It's a good practice anyway since NetBeans will use a relative classpath and thus if you move the project itself NetBeans won't give you an error message when loading the project.

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