Unity Manual User Guide Asset Import and Creation Importing Assets

Importing Assets

Unity will automatically detect files as they are added to your Project folder's Assets folder. When you put any asset into your Assets folder, you will see the asset appear in your Project View.

importing_20assets-0.jpg

The Project View is your window into the Assets folder, normally accessible from the file manager When you are organizing your Project View, there is one very important thing to remember: Never move any assets or organize this folder from the Explorer (Windows) or Finder (OS X). Always use the Project View! There is a lot of meta data stored about relationships between asset files within Unity. This data is all dependent on where Unity expects to find these assets. If you move an asset from within the Project View, these relationships are maintained. If you move them outside of Unity, these relationships are broken. You'll then have to manually re-link lots of dependencies, which is something you probably don't want to do. So just remember to only save assets to the Assets folder from other applications, and never rename or move files outside of Unity. Always use Project View. You can safely open files for editing from anywhere, of course.

Creating and Updating Assets

When you are building a game and you want to add a new asset of any type, all you have to do is create the asset and save it somewhere in the Assets folder. When you return to Unity or launch it, the added file(s) will be detected and imported. Additionally, as you update and save your assets, the changes will be detected and the asset will be re-imported in Unity. This allows you to focus on refining your assets without struggling to make them compatible with Unity. Updating and saving your assets normally from its native application provides optimum, hassle-free workflow that feels natural.

Asset Types

There are a handful of basic asset types that will go into your game. The types are: Mesh Files & Animations Texture Files Sound Files We'll discuss the details of importing each of these file types and how they are used. Meshes & Animations Whichever 3D package you are using, Unity will import the meshes and animations from each file. For a list of applications that are supported by Unity, please see this page. Your mesh file does not need to have an animation to be imported. If you do use animations, you have your choice of importing all animations from a single file, or importing separate files, each with one animation. For more information about importing animations, please see page about Animation Import. Once your mesh is imported into Unity, you can drag it to the Scene or Hierarchy to create an instance of it. You can also add Components to the instance, which will not be attached to mesh file itself. Meshes will be imported with UVs and a number of default Materials (one material per UV). You can then assign the appropriate texture files to the materials and complete the look of your mesh in Unity's game engine. Textures Unity supports all image formats. Even when working with layered Photoshop files, they are imported without disturbing the Photoshop format. This allows you to work with a single texture file for a very care-free and streamlined experience. You should make your textures in dimensions that are to the power of two (e.g. 32×32, 64×64, 128×128, 256×256, etc.) Simply placing them in your project's Assets folder is sufficient, and they will appear in the Project View. Once your texture has been imported, you should assign it to a Material. The material can then be applied to a mesh, Particle System, or GUI Texture. Using the Import Settings, it can also be converted to a Cubemap or Normalmap for different types of applications in the game. For more information about importing textures, please read the Texture Component page. Sounds Desktop Unity features support for two types of audio: Uncompressed Audio or Ogg Vorbis. Any type of audio file you import into your project will be converted to one of these formats. File Type Conversion .AIFFConverted to uncompressed audio on import, best for short sound effects. .WAVConverted to uncompressed audio on import, best for short sound effects. .MP3Converted to Ogg Vorbis on import, best for longer music tracks. .OGGCompressed audio format, best for longer music tracks. Import Settings If you are importing a file that is not already compressed as Ogg Vorbis, you have a number of options in the Import Settings of the Audio Clip. Select the Audio Clip in the Project View and edit the options in the Audio Importer section of the Inspector. Here, you can compress the Clip into Ogg Vorbis format, force it into Mono or Stereo playback, and tweak other options. There are positives and negatives for both Ogg Vorbis and uncompressed audio. Each has its own ideal usage scenarios, and you generally should not use either one exclusively. Read more about using Ogg Vorbis or Uncompressed audio on the Audio Clip Component Reference page.

iOS Unity features support for two types of audio: Uncompressed Audio or MP3 Compressed audio. Any type of audio file you import into your project will be converted to one of these formats. File Type Conversion .AIFFImports as uncompressed audio for short sound effects. Can be compressed in Editor on demand. .WAVImports as uncompressed audio for short sound effects. Can be compressed in Editor on demand. .MP3Imports as Apple Native compressed format for longer music tracks. Can be played on device hardware. .OGGOGG compressed audio format, incompatible with the iPhone device. Please use MP3 compressed sounds on the iPhone. Import Settings When you are importing an audio file, you can select its final format and choose to force it to stereo or mono channels. To access the Import Settings, select the Audio Clip in the Project View and find Audio Importer under Inspector tab. Here, you can compress the Clip into Ogg Vorbis format, force it into Mono or Stereo playback, and tweak other options, like very important Decompress On Load setting. Read more about using MP3 Compressed or Uncompressed audio on the Audio Clip Component Reference page.

Android Unity features support for two types of audio: Uncompressed Audio or MP3 Compressed audio. Any type of audio file you import into your project will be converted to one of these formats. File Type Conversion .AIFFImports as uncompressed audio for short sound effects. Can be compressed in Editor on demand. .WAVImports as uncompressed audio for short sound effects. Can be compressed in Editor on demand. .MP3Imports as MP3 compressed format for longer music tracks. .OGGOGG compressed audio format, is incompatible with some Android devices, so Unity does not support it for Android platform. Please use MP3 compressed sounds instead. Import Settings When you are importing an audio file, you can select its final format and choose to force it to stereo or mono channels. To access the Import Settings, select the Audio Clip in the Project View and find Audio Importer under Inspector tab. Here, you can compress the Clip into Ogg Vorbis format, force it into Mono or Stereo playback, and tweak other options, like very important Decompress On Load setting. Read more about using MP3 Compressed or Uncompressed audio on the Audio Clip Component Reference page.

Once sound files are imported, they can be attached to any GameObject. The Audio file will create an Audio Source Component automatically when you drag it onto a GameObject. Previous Next

unity_manual/importing_assets.txt · ostatnio zmienione: 2012/09/30 11:39 (edycja zewnętrzna)
Recent changes RSS feed Debian Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki