目录

Asset Import and Creation 资源导入与创建

优质
小牛编辑
124浏览
2023-12-01

A large part of making a game is utilizing your asset source files in your GameObjects. This goes for textures, models, sound effects and behaviour scripts. Using the Project View inside Unity, you have quick access to all the files that make up your game:

做一个游戏的很大一部分是在你的游戏对象中使用资源源文件,比如纹理、模型、声音效果和行为脚本。使用Unity中的项目视图,你可以快速存取所有文件来构建你的游戏:

Asset Import and Creation(资源导入与创建)
The Project View displays all source files and created Prefabs
项目视图显示所有源文件和创建的预设

This view shows the organization of files in your project's Assets folder. Whenever you update one of your asset files, the changes are immediately reflected in your game!

这个视图显示了在你的项目资源文件夹中的文件组织结构。每当你更新一个你的资源文件,更改会立即反映在你的游戏中!

To import an asset file into your project, move the file into (your Project folder)->Assets in the Finder, and it will automatically be imported into Unity. To apply your assets, simply drag the asset file from the Project View window into the Hierarchy or Scene View. If the asset is meant to be applied to another object, drag the asset over the object.

要导入资源文件到你的项目中,在探测器中移动文件到(你的项目文件夹)- > Assets文件夹,它会自动导入到Unity中。要应用你的资源,只要从项目视图窗口中拖动资源文件到层次视图或场景视图中即可。如果资源打算应用到另一个项目,拖动资源到项目上。

Hints 提示

  • Is always a good idea to add labels to your assets when you are working with big projects or when you want to keep organized all your assets, with this you can search for the labels associated to each asset in the search field in the project view.
    当你正在使用大项目,或者你想让你的资源保持组织有序时,为你的资源添加标签是一个好主意,你可以在项目视图中利用搜索字段搜索到每个相关标签的资源。
  • When backing up a project folder always back up both Library and Assets folders. The Library folder contains all meta data and all the connections between objects, thus if the Library folder gets lost, you will lose references from scenes to assets. Easiest is just to back up the whole project folder containing both the Assets and Library folder.
    当备份项目文件夹时总是会同时备份库和资源文件夹。库文件夹包含所有的元数据和对象之间的所有连接,因此,如果库文件夹丢失,你将丢失从场景到资源的参照。最简单的是备份包含资源和库文件夹的全部项目文件夹。
  • Rename and move files to your heart's content inside Project View; nothing will break.
    在你的项目视图里面重命名和移动文件的核心内容;什么都不会破坏。
  • Never rename or move anything from the Finder or another program; everything will break. In short, Unity stores lots of metadata for each asset (things like import settings, cached versions of compressed textures, etc.) and if you move a file externally, Unity can no longer associate metadata with the moved file.
    永远不要从探测器重命名或移动任何东西到另一个程序,这将破坏一切。总之,Unity为每个资源(如导入设置的东西、压缩纹理缓存版本等)存储了大量的元数据,如果你从外部移动一个文件,Unity将不可以再为移动的文件关联元数据。

Continue reading for more information 继续阅读更多信息: