mporting Assets

导入资源

Assets created outside of Unity must be brought in to Unity by having the file either saved directly into the “Assets” folder of your project, or copied into that folder. For many common formats, you can save your source file directly into your project’s Assets folder and Unity will be able to read it. Unity will notice when you save new changes to the file and will re-import as necessary.

在Unity外创建的资源必须直接保存或复制到你项目的资源文文件夹中.对于许多通用格式,你可直接保存你的源文件到你的项目资源文件夹,Unity将会读取它.当你的保存出现变化时Unity会发出通知,若有必要将要重新导入.

When you create a Unity Project, you are creating a folder - named after your project - which contains the following subfolders:

当你创建一个项目,你是在创建一个文件夹----命名你的项目----包含下面的子文件夹.

The basic file structure of a Unity Project

Unity项目的基本文件结构

The Assets folder is where you should save or copy files that you want to use in your project.

资源文件夹是你保存或复制用于项目的文件之地.

The contents of the Project Window in Unity shows the items in your Assets folder. So if you save or copy a file to your Assets folder, it will be imported and become visible in your Project Window.

项目窗口的内容显示了你资源文件夹的子项目.所以如果你保存或复制一个文件到你的资源文件夹中,它将会被导入并显示在你的项目窗口上.

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

当文件被添加到资源文件夹或它们被修改Unity都会发现.当你把任何资源添加到资源文件夹你都会在项目视图上看到它们.

The Project Window shows assets that have been imported into your project

项目视图显示资源被导入到了项目中.

If you drag a file into Unity’s Project Window from your computer (eg, from the Finder on Mac, or from Explorer on Windows), it will be copied into your Assets folder, and will appear in the Project window.

如果你拖拽一个文件到Unity项目视图中,它将会拷贝到你的资源文件夹内,并且可以在项目视图中找到它.

The items you see in your Project window represent (in most cases) actual files on your computer, and if you delete them within Unity, you are deleting them from your computer too.

你在项目视图上看到的文件(在大多数情况下)都是你电脑上真实存在的文件,如果你在Unity中删除了它们也会在电脑中删除它们.

The relationship between the Assets Folder in your Unity Project on your computer, and the Project Window within Unity

你电脑上资源文件夹和Unity项目视图的关系

The above image shows an example of a few files and folders inside the Assets folder of a Unity project. You can create as many folders as you like and use them to organise your Assets.

上面的图片显示了一些文件和文件夹在一个Unity项目的资源文件夹中.你可以创建许多这样的文件夹用来管理你资源.

You’ll notice in the image above that there are .meta files listed in the file system, but not visible in Unity’s Project Window. Unity creates these .meta files for each asset and folder, but they are hidden by default, so you may not see them in your Explorer/Finder either.

你会注意到在上面图片中有些".meta"文件在文件系统中,但在Unity项目视图中却看不到.Unity给每个资源或文件夹创建一个".meta"文件,默认是隐藏的,所以你可能会在资源管理器中看不到它们.

They contain important information about how the asset is used in the project and they must stay with the asset file they relate to, so if you move or rename an asset file in Explorer/Finder, you must also move/rename the meta file to match.

它们包含关于资源如何在项目中使用的重要信息并且它们必须和相关资源文件放在一起,如果你在资源管理器中移动或重命名一个资源文件,你必须匹配移动/重命名它的".meta"文件.

The simplest way to safely move or rename your assets is to always do it from within Unity’s project folder. This way, Unity will automatically move or rename the corresponding meta file. If you like, you can read more about .meta files and what goes on behind-the-scenes during the importprocess.

最简单的安全移动和重命名资源的方式是总是在Unity中的项目视图上做.这样Unity将会自动移动或重命名相应的".meta"文件.更多关于".meta"文件信息参考:幕后的导入过程.

If you want to bring collections of assets into your project, you can use Asset Packages. See Asset Packages for more details.

如果你想使用资源的集合到你的项目中,你可以使用资源包,更多信息参考:资源包.

Some common types of Asset

一些普通资源类型

Image Files

图片文件

Most common image file types are supported, such as BMP, TIF, TGA, JPG, and PSD. If you save your layered Photoshop (.psd) files into your Assets folder, they will be imported as flattened images. You can find out more about importing images with alpha channels from photoshop, or importing your images as sprites

Unity支持大部分普通图片文件类型,如:bmp,tif,tga,jpg和psd.如果你保存Photoshop图层文件(psd)到资源文件夹,它们会变为平整图片(合并图层).更多参考:从photoshop导入带alpha通道的图片和导入你的图片作为精灵.

3D Model Files

3D模型文件

If you save your 3D files from most common 3D software packages in their native format (eg, .max, .blend, .mb, .ma) into your Assets folder, they will be imported by calling back to your 3D package’s FBX export plugin (*). Alternatively you can export as FBX from your 3D app into your Unity project. Read more about importing 3D files from your 3D app.

如果你导入大部分常用3D软件(如:max,blend,mb,ma)原始格式的3D文件到你的资源文件夹,它们将被回调你的3D包的FBX导出插件.或者你可以从你的3D软件以FBX格式导出到你Unity项目中.更多参考:从3D程序导入3D文件.

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.

不论你使用哪种3D包,Unity都可以导入每个文件的网格和动画.关于哪些程序是Unity支持的,参考(链接).

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 of the manual.

导入网格文件不一定要包含动画.如果你要用到动画,你可以选择从一个文件一次导入所有动画或从多个文件导入,每个文件包含一个动画.更多关于导入动画的信息,参考相关手册.

Audio Files

声音文件

If you save uncompressed audio files into your Assets folder, they will be imported according to the compression settings specified. Read more about importing audio files.

如果你保存未压缩声音文件到资源文件夹,它们将通过压缩设置规定导入.更多参考:导入声音文件.

Other Asset Types

其他资源类型

In all cases, your original source file is never modified by Unity, even though within Unity you can often choose between various ways to compress, modify, or otherwise process the asset. The import process reads your source file, and creates a game-ready representation of your asset internally, matching your chosen import settings. If you modify the import settings for an asset, or make a change to the source file in the Asset folder, will cause Unity to re-import the asset again to reflect your new changes.

就一切情况而论,在Unity中你的原始资源文件并不会修改,虽然在Unity通常可以选择许多方式去压缩,修改或其他方式处理资源.导入资源文件过程中,会匹配你的导入设置,创建用于游戏的内部表示.如果你修改了一个资源的导入设置,或者在资源文件夹内修改了资源文件,将会引起Unity重新导入资源以响应你修改.

Note: Importing native 3D formats requires the 3D application to be installed on the same computer as Unity. This is because Unity uses the 3D application’s FBX exporter plug-in to read the file. Alternatively, you can directly export as FBX from your application and save into the Projects folder.

注意:导入原始3D格式需要3D程序和Unity安装在同一台电脑上.这是因为Unity需要3D程序的FBX导出插件来读取文件.或者,你可以直接以FBX格式从程序导出再保存到你的项目文件夹中.

See also:

更多参考:

·         Asset Packages资源包

·         Importing Meshes导入网格

·         3D formats 3D格式

·         Animation Import动画导入

·         Materials and Shaders材质和着色器

·         Textures and Videos贴图和视频

·         Sprite Editor精灵编辑器

·         Sprite Packer精灵包装器

·         Procedural Materials程序化材质

·         Audio Files声音文件

·         Tracker Modules跟踪模块

Unity说明文档翻译-Importing Assets相关推荐

  1. [Unity官方文档翻译]Downloading and Installing Unity下载和安装unity教程

    1.Downloading and Installing Unity 下载和安装unity You can download and install the Unity Editor from the ...

  2. [Unity官方文档翻译]2D or 3D Projects Unity中2D和3D项目的区别

    2D or 3D Projects 2D或3D项目 Unity is equally suited to creating both 2D and 3D games. But what's the d ...

  3. cannot build player while editor is importing assets or compiling scripts

    unity使用中碰到上面问题,在此记录一下.... 解决办法:将unity中所有带有using UnityEditor的脚本里将这块引用删掉. 我自己都不知道为啥之前引用了..(新手记录,大佬看到有问 ...

  4. 2020Unity中文项目用Vs2019打开脚本后一直Importing assets

    unity2018就不会有这个问题,而且我的External Script Editor 都设置的没有问题,新建一个项目中文名,在不用vs2019打开脚本之间都不会有这个进度条,一打开后就会有,高级编 ...

  5. Unity学习笔记 - Assets, Objects and Serialization

    Assets和Objects Asset是存储在硬盘上的文件,保存在Unity项目的Assets文件夹内.比如:纹理贴图.材质和FBX都是Assets.一些Assets以Unity原生格式保存数据,例 ...

  6. unity中创建游戏场景_在Unity中创建Beat Em Up游戏

    unity中创建游戏场景 Learn how to use Unity to create a 3D Beat Em Up game in this full tutorial from Awesom ...

  7. unity实习生简历_实习生与Unity学习

    unity实习生简历 Working with video games doesn't sound like a terrible idea, does it? Expressing your cre ...

  8. unity 2017介绍_介绍Unity 2017

    unity 2017介绍 We're excited to announce that Unity 2017.1 has been released and is now available for ...

  9. 如何导出android studio程序,Android Studio 如何导出 Jar 给 Unity 使用

    大致步骤如下:1.创建新的 Android Studio 工程2.为此 Android Studio 工程创建 Android Library 类库(也就是一个 Module)(后面就是用它生成 ja ...

最新文章

  1. table 锁定表头
  2. C# ACCESS数据库操作类
  3. Grunt 常用插件
  4. MapReduce源码分析总结
  5. Ollydbg中断方法浅探
  6. 11.Wave Shader
  7. 2018 ICPC Asia Jakarta Regional Contest J. Future Generation 状压dp
  8. php scandir遍历,php使用scandir()函数扫描指定目录下所有文件示例
  9. 程序员的“黄金时代”,死去又重来?
  10. 【项目.源码】深度学习实现任意风格任意内容的极速风格迁移
  11. 安装python包管理系统_什么时候安装外部python包全局,什么时候本地?pip还是系统包管理器?...
  12. Java (计算机编程语言)
  13. mysql创建数据库的语法_mysql创建数据库语法
  14. 关于解决miui10国际版刷入之后无法认证的问题
  15. 使用db1小波做3层小波分解
  16. html如何调用function,请问HTML function函数怎么定义和调用?
  17. 程序员都需要会的JVM调优总结 -Xms -Xmx -Xmn -Xss,附idea配置实战(程序员必学)
  18. 第一百二十一天 : varnish
  19. pandas学习-变形-task15
  20. Cannot construct instance of `com.baomidou.mybatisplus.core.metadata.IPage`

热门文章

  1. 【翻译】生物集成可穿戴系统:综合回顾
  2. set在python里是什么意思_set在python里的含义和用法
  3. Mac上免费epub阅读器推荐
  4. 百度云bce bos签名认证完整示例 -- 亲测通过
  5. 2021年第三届传智杯全国大学生IT技能大赛(决赛B组)
  6. ADM Radeon R9 NANO参数
  7. VennDiagram包画韦恩图
  8. Material Design复杂响应式设计
  9. reject(res)
  10. 在企业中git的使用流程,看完少挨骂哦~