This area of the Unity User Manual provides a general overview of the principles of working with Assets in Unity, including the following topics:
.unitypackageextension. Asset packages are a handy way of sharing and re-using Unity Projects and collections of Assets. More info
In addition, there are some related topics in other sections of the manual, such as:
An Asset is a representation of any item you can use in your Project. An Asset might come from a file created outside of Unity, such as a 3D Model, an audio file, or an image. There are also some Asset types that you can create in Unity, such as a ProBuilder MeshThe main graphics primitive of Unity. Meshes make up a large part of your 3D worlds. Unity supports triangulated or Quadrangulated polygon meshes. Nurbs, Nurms, Subdiv surfaces must be converted to polygons. More info
See in Glossary, an Animator ControllerControls animation through Animation Layers with Animation State Machines and Animation Blend Trees, controlled by Animation Parameters. The same Animator Controller can be referenced by multiple models with Animator components. More info
See in Glossary, an Audio Mixer, or a Render TextureA special type of Texture that is created and updated at runtime. To use them, first create a new Render Texture and designate one of your Cameras to render into it. Then you can use the Render Texture in a Material just like a regular Texture. More info
See in Glossary.
Unity automatically imports Assets and manages various kinds of additional data about them for you, such as what import settings should be used to import the Asset, and where the Asset is used throughout your Project. Below is a description of how this process works:
In some cases, Unity might create multiple Assets while importing a single Asset file. For more information, see Importing complex Assets.
When you place an Asset such as a Texture in the
Assets folder, Unity detects that a new file has been added because the Editor frequently checks the contents of the
Assets folder against the list of Assets it already knows about).
As soon as Unity finds the new file, it assigns a unique ID to the Asset. This is an ID that Unity uses internally to reference the Asset, so that Unity can move or rename the Asset without breaking anything.
This example shows that Unity creates a
.meta file for each Asset or folder inside the Project’s
Assets folder, as they appear in a system file browser. However, these
.meta files are not visible in Unity’s Project window because they are hidden by default. You can make them visible by selecting Visible Meta Files from the Mode Project setting.
When Unity creates a
.meta file for an Asset, it writes the Asset’s ID inside the
.meta file and stores the
.meta file in the same location as the Asset file. The
.meta file must stay in the same location as the Asset file it relates to, because it contains the Asset’s ID. If you move or rename an Asset within Unity’s own Project window, Unity automatically moves or renames the corresponding
.meta file. However, if you move or rename an Asset outside of Unity (for example, through your system’s file browser), make sure you move or rename the
.meta file to match.
If an Asset loses its
.meta file (for example, if you moved or renamed the Asset outside of Unity’s Project window, without updating its
.meta file), any reference to that Asset breaks, and Unity generates a new
.meta file for the Asset as if it were a different Asset, deleting the old “orphaned”
For example, in the case of a Texture Asset losing its
.meta file, any Materials which used that Texture no longer have a reference to the Texture. To fix it you would have to manually re-assign that Texture to any Materials which required it.
Similarly, when a script Asset attached to a GameObjectThe fundamental object in Unity scenes, which can represent characters, props, scenery, cameras, waypoints, and more. A GameObject’s functionality is defined by the Components attached to it. More info
See in Glossary (or Prefab) loses its
.meta file, that GameObject loses the script’s functionality, and ends up with an “unassigned script” component. To fix this, you must manually re-assign the script to the GameObject.
Unity reads and processes any files that you add to the
Assets folder, converting the contents of the file to internal game-ready data. The Asset files themselves remain unchanged, and the internal data are stored in the Project’s
Using internal formats for Assets allows Unity to have game-ready versions of your Assets ready to use at runtime in the Editor, while keeping your unmodified source files in the the
Assets folder. Keeping the internal formats separate from the Asset files means that you can quickly edit them and have the Editor pick up the changes automatically. For example, the Photoshop file format is convenient to work with and you can save
.psd files directly into your
Assets folder, but hardware such as mobile devices and PC graphics cards can’t process that format directly in order to render them as Textures.
Unity stores the internal representation of your Assets in the
Library folder which is like a cache folder. As a user, you should never have to alter the
Library folder manually, and attempting to do so may negatively affect your Project in the Unity Editor. However, as long as the Project is not open in Unity, you can safely delete the
Library folder, because Unity can regenerate all of its data from the
ProjectSettings folders. This also means that you should not include the
Library folder under version controlA system for managing file changes. You can use Unity in conjunction with most common version control tools, including Perforce, Git, Mercurial and PlasticSCM. More info
See in Glossary.
Sometimes Unity creates multiple Assets when it imports a single Asset file. For example, this can occur in the following situations:
|Import scenario:||How Unity handles the file:|
|When a 3D file (such as an FBX file) defines Materials or contains embedded Textures.||Unity extracts the Materials and embedded Textures as separate Assets.|
|When you want to import an image file as multiple 2D spritesA 2D graphic objects. If you are used to working in 3D, Sprites are essentially just standard textures but there are special techniques for combining and managing sprite textures for efficiency and convenience during development. More info
See in Glossary.
|Use the 2D Sprite Editor to define multiple sprites from a single graphic image. In this case, each sprite defined in the Editor appears as a separate Sprite Asset in the Project window.|
|When a 3D file contains multiple animation timelines or multiple clips.||Unity automatically defines separate animation timelines or clips based on its animation import settings. The resulting multiple animation clips appear as separate Animation ClipAnimation data that can be used for animated characters or simple animations. It is a simple “unit” piece of motion, such as (one specific instance of) “Idle”, “Walk” or “Run”. More info
See in Glossary Assets in the Project window.
As well as the unique ID assigned to the Asset, the
.meta files contain values for all the import settings you see in the InspectorA Unity window that displays information about the currently selected GameObject, Asset or Project Settings, alowing you to inspect and edit the values. More info
See in Glossary window when you select an Asset in your Project window. For a Texture, this includes the Texture Type, Wrap Mode, Filter Mode and Aniso LevelThe anisotropic filtering (AF) level of a texture. Allows you to increase texture quality when viewing a texture at a steep angle. Good for floor and ground textures. More info
See in Glossary import settings.
If you change the import settings for an Asset, those new settings are saved to the
.meta file accompanying the Asset. Unity then re-imports the Asset according to your updated settings, and then updates the corresponding imported “game-ready” data in the Project’s
When backing up a Project, or adding a Project to a version control repository, make sure you include the main Unity
Project folder, containing both the
ProjectSettings folders. Unity relies on the information in these folders in order to reimport your Assets and reconstruct your game or application. Don’t back up the
Temp folders or put them under version control.