James
James

Reputation: 35

Can I add an external library to my project?

I'm currently working on a game, however I'm struggling at the moment. I asked my tutor for help, and he sent me a library file. Not the scene. I'm a bit confused on how to add those library files to my current project.

Upvotes: 0

Views: 14590

Answers (3)

ADAMJR
ADAMJR

Reputation: 2738

If the library file is a unitypackage file or ends with .asset, it could be imported into Unity. Importing assets basically is like unzipping the contents (assets) into Unity. This is done to keep assets in one place and help them be easily transferable.

https://docs.unity3d.com/Manual/AssetPackages.html

Importing Asset packages

You can import Standard Asset Packages, which are Asset collections pre-made and supplied with Unity, and Custom Asset Packages, which are made by people using Unity.

To import an Asset package:

Importing Custom Assets

1) Open the Project you want to import Assets into.

2) Choose Assets > Import Package > Custom Package.

3) In the file explorer, select the package you want and the Import Unity Package dialog box appears, with all the items in the package pre-checked, ready to install. (See Import Unity Package dialog box image below.)

4) Select Import and Unity puts the contents of the package into the Assets folder, which you can access from your Project view.

To import custom assets:

Hopefully this helps. Let me know if you have any other questions.

Upvotes: 1

Frenchy
Frenchy

Reputation: 17007

You just add the Dll to your project and when you open a script in visual studio or other, your references include the new dll .

Of course your Dll is in C#...

Upvotes: 2

Warty
Warty

Reputation: 7395

This can be taken a few ways:

  1. They've sent you a Unity Library folder
  2. They've sent you a Unity Assets folder
  3. They've sent you a dynamically linked library containing code
  4. They've sent you an asset package

Let's discuss our options:

1. They've sent you a Unity Library folder

They've sent you the wrong folder. They probably meant to send you an Assets folder, so ask them for that. Unity's Library folder is conceptually a cache containing Unity's internal state representing your assets. Without the corresponding assets, it's useless in your case.

2. They've sent you a Unity Assets folder

You can copy / merge that into an existing project's Assets folder by hand.

3. They've sent you a dynamically linked library containing code

If they've sent you a *.dll, this is probably a .NET assembly. Simply drag and drop it somewhere into your Assets folder, load/refresh Unity, and it'll automatically be referenced in your C# code. (One can also import native .so/.dll files, but that's probably out of scope for this answer.)

4. They've sent you an asset package

Follow the instructions here https://docs.unity3d.com/Manual/AssetPackages.html (reached via googling unity import asset package).

As a final note, your tutor is there for you - you are paying for their tutoring services and should feel no shame leveraging their tutoring services (e.g. "how do I use these files?").

Upvotes: 4

Related Questions