unity3d导入资源工作流程
Alcohol1982原创翻译,不对之处敬请指出。
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 see this page.
使用支持的3D建模软件创建你的基础资源,我们将使用Maya,直到你做好基础资源并且保存。这个列表中的软件都是被unity支持的。
unity3d animationImport(导入)
When you save your asset initially, you should save it normally to the Assets folder in your Project folder. When you open the Unity project, the asset will be detected and imported into the project. When you look in the Project 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 see this page.
首先,当你保存了你做好的资源(模型),你需要把它保存在项目文件夹下的assest文件夹里。这样当你启动unity项目时这个资源将被检测到并且导入到项目中。在unity的项目窗口中可以看到它。请注意,unity 使用的FBX格式由你所使用的建模软件转换格式。你需要
有你使用的建模软件的FBX导出器来为unity使用,或者你可以从你的建模软件里直接导出FBX格式存到项目文件夹。这个列表中的软件都是被unity支持的。
Import Settings(导入设置)
If you select the asset in the Project View the import settings for this asset will appear in the Inspector. 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 the Hierarchy or Scene View to add it to the Scene. When you drag a mesh to the scene, you are creating a GameObject that has a Mesh 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 a Material
贴图应用于材质
A Material is applied to a GameObject (with a Mesh Renderer Component)
材质应用于游戏对象(在meshrenderer组件中)
An Animation is applied to a GameObject (with an Animation Component)
动画应用于游戏对象(在animation组件中)
A sound file is applied to a GameObject (with an Audio 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 choose GameObject->Apply Changes to Prefab from the main menu. This can save you lots of time during setup and updating of assets.
Prefabs是一批可以在场景中重复使用的游戏对象或组件。多个完全相同的物体可以创建一个prefab预制,实例调用。以树为例。创建一个树的预制允许你在场景中放置多个完全相同的树。因为所有的树都是实例关联,当你改动预制的任何参数时,它们会自动的应用到所有树上。所以,如查你想改动网格、材质或别的东西,你只需要在预制中改动一次,所有的树将会随着改变。你也可以改变所有树中的其中一个实例,然后在菜单中选择GameObject(游戏对象)->Apply Changes to Prefab(应用改变到预制),这可以帮你节省大量的时间在重复设置和更新资源上。
When you have a GameObject that contains multiple Components and a hierarchy of child GameObjects, you can make a Prefab of the top-level GameObject (or root), and re-use the entire collection of GameObjects.
如查你的游戏对象包括许多的组件或子物体,你可以用父物体或根做预制然后再使用。
Think of a Prefab as a blueprint for a structure of GameObjects. All the Prefab clones are identical to the blueprint. Therefore, if the blueprint is updated, so are all the clones. There are different ways you can update the Prefab itself by changing one of its clones an
d applying those changes to the blueprint. To read more about using and updating Prefabs, please view the Prefabs page.
考虑一个预制作为一种结构的游戏对象蓝图。所有的预制克隆是完全相同的蓝图。因此,如果蓝图被更新,所有的克隆也会更新。有不同的方式你可以更新预制本身,通过改变它的一个克隆,应用那些变化到蓝图。
To actually create a Prefab from a GameObject in your scene, first create a new Prefab in your Project View. Name the new Prefab whatever you like. Then, click on the Game Object in the scene that you want to make into a Prefab. Drag it to the new Prefab, and you should see the Game Object's name text turn blue. You have now created a re-usable prefab.
事实上要在场景中建立一个游戏对象预制,首先建立一个新的prefab在项目窗口中,起成你想要的名字,然后选择你想建立预制的游戏对象拖动到prfab中,然后你可以看到游戏对象的名字变成蓝,标志你成功建立一个合格的预制。
Updating Assets(更新资源)
You have imported, instantiated, and linked your asset to a Prefab. Now when you want to edit your source asset, just double-click it from the Project View. The appropriate application will launch, and you can make any changes you want. When you're done updating it, just Save it. Then, when you switch back to Unity, the update will be detected, and the asset will be re-imported. The asset's link to the Prefab will also be maintained. So the effect you will see is that your Prefab will update. That's all you have to know to update assets. Just open it and save!
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。
发表评论