Asset Workflow(资源工作流程)
Here we'll explain the steps to use a single asset with Unity. These steps are general and are meant only
as an overview for basic actions. For the example, we'll talk about using a 3D mesh.
这里我们将介绍unity中使用一个asset的步骤。这些步骤是一个基本行为的常规、必须步骤。例如:我们
将说说使用3D mesh。
Create Rough Asset
(建立一个草图资源)
Use any supported 3D modeling package to create a rough version of your asset. Our example will use
Maya. Work with the asset until you are ready to save. For a list of applications that are supported by
Unity, please seethis page
使用支持的3D建模软件创建你的基础资源,我们将使用Maya,直到你做好基础资源并且保存。这个列表
中的软件都是被unity支持的。
Import(导入)
When you save your asset initially, you should save it normally to theAssetsfolder in your Project folder.
When you open the Unity project, the asset will be detected and imported into the project. When you look
in theProject View, you'll see the asset located there, right where you saved it. Please note that Unity
uses the FBX exporter provided by your modeling package to convert your models to the FBX file format.
You will need to have the FBX exporter of your modeling package available for Unity to use. Alternatively,
you can directly export as FBX from your application and save in the Projects folder. For a list of
applications that are supported by Unity, please seethis page
首先,当你保存了你做好的资源(模型),你需要把它保存在项目文件夹下的assest文件夹里。这样当你
启动unity项目时这个资源将被检测到并且导入到项目中。在unity的项目窗口中可以看到它。请注意,unity
使用的FBX格式由你所使用的建模软件转换格式。你需要有你使用的建模软件的FBX导出器来为unity使
用,或者你可以从你的建模软件里直接导出FBX格式存到项目文件夹。这个列表中的软件都是被unity支持的。
Import Settings(导入设置)
If you select the asset in theProject Viewthe import settings for this asset will appear in theInspector
The options that are displayed will change based on the type of asset that is selected.
如果你在Project面板中选择了你的资源,导入设置将在inspector面板中显示出来。显示出来的选项由选
择的资源类型而定。
Adding Asset to the Scene(增加资源到场景)
Simply click and drag the mesh from the Project View to theHierarchyorScene Viewto add it to the
Scene. When you drag a mesh to the scene, you are creating aGameObjectthat has aMesh Renderer
Component. If you are working with a texture or a sound file, you will have to add it to a GameObject that
already exists in the Scene or Project.
通过拖拽你的资源从project窗口到hierarchy窗口或scene视窗就可以把资源添加进场景。当你拖拽资源到场景,
就建立了一个gameobject(游戏对象),它包括一个mesh renderer component(网格渲染组件),
如果是对一个贴图或声音进行操作,你得把它们添加到一个gameobject上,gameobject必须已经存在于场景或项目中。
Putting Different Assets Together(将不同的资源放置在一起)
Here is a brief description of the relationships between the most common assets
普通资源之间的关系简要说明
A Texture is applied to aMaterial贴图应用于材质
A Material is applied to a GameObject (with a Mesh Renderer Component)材质应用于游戏对象(在
meshrenderer组件中)AnAnimationis applied to a GameObject (with an Animation Component)
动画应用于游戏对象(在animation组件中)A sound file is applied to a GameObject (with anAudio Source
Component)声音文件应用于游戏对象(在audiosource组件中)Creating a Prefab(建立预制)Prefabs
are a collection of GameObjects & Components that can be re-used in your scenes. Several
identical objects can be created from a single Prefab, called instancing. Take trees for example. Creating
a tree Prefab will allow you to instance several identical trees and place them in your scene. Because the
trees are all linked to the Prefab, any changes that are made to the Prefab will automatically be applied to
all tree instances. So if you want to change the mesh, material, or anything else, you just make the
change once in the Prefab and all the other trees inherit the change. You can also make changes to an
instance, and chooseGameObject->Apply Changes to Prefabfrom the main menu. This can save you
lots of time during setup and updating of assets.Prefabs
是一批可以在场景中重复使用的游戏对象或组件。多个完全相同的物体可以创建一个prefab预制,
实例调用。以树为例。创建一个树的预制允许你在场景中放置多个完全相同的树。因为所有的树都是实例
关联,当你改动预制的任何参数时,它们会自动的应用到所有树上。所以,如查你想改动网格、材质或别
的东西,你只需要在预制中改动一次,所有的树将会随着改变。你也可以改变所有树中的其中一个实例,
然后在菜单中选择
GameObject(游戏对象)
->Apply Changes to Prefab(应用改变到预制)
,这可以
帮你节省大量的时间在重复设置和更新资源上。