Unity资源工作流程(Asset Workflow)

资源工作流程

Asset Workflow

Manual

Reference

Scripting

Unity Manual >User Guide >Unity Basics >Asset Workflow

 

原文链接:http://docs.unity3d.com/Documentation/Manual/AssetWorkflow.html

 

小弟第一次翻译,还希望各位指正。

 

资源工作流程

Asset Workflow

这里我们将介绍如何使用Unity资源。这些步骤都都针对与一般的资源和基础活动。例如,我们将使用一个3D网格。

Here we'll explain the steps to use asingle asset with Unity. These steps are general and are meant only as anoverview for basic actions. For the example, we'll talk about using a 3D mesh.

Create Rough Asset

创建未加工资源

 

我们可以使用所有支持的3D模型文件来创建一个属于你的未加工资源。我们例子中将使用Maya单击此处获得Unity支持的应用程序列表。

Use any supported 3D modeling package tocreate a rough version of your asset. Our example will use Maya. Work with theasset until you are ready to save. For a list of applications that aresupported by Unity, please see thispage.

导入

Import

当你保存最初的资源,你需要将它保存你工程目录下的Assets文件夹下。这样,当你在打开Unity工程时,这个资源就能被监测到并添加到工程中。当你查看Project视图时,你就能看到这个资源已经存在于你保存的位置了。请注意Unity使用FBX格式的模型文件,请将的模型文件转换为FBX格式。你可以直接将你到处的FBX文件直接保存到工程文件夹下。单击此处获得Unity支持的应用程序列表。

When you save your asset initially, youshould save it normally to theAssets folder in your Project folder.When you open the Unity project, the asset will be detected and imported intothe project. When you look in theProject View, you'll see the assetlocated there, right where you saved it. Please note that Unity uses the FBXexporter provided by your modeling package to convert your models to the FBXfile format. You will need to have the FBX exporter of your modeling packageavailable for Unity to use. Alternatively, you can directly export as FBX fromyour application and save in the Projects folder. For a list of applicationsthat are supported by Unity, please seethispage.

导入设置

Import Settings

如果你在Project视图中选择了一个资源,那么关于该资源的导出设置将出现在Inspector中。这些设置将更具所选择的资源类型而发生变化。

If you select the asset in the ProjectView 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 isselected.

添加资源到场景

Adding Asset tothe Scene

Project视图中通过单击和拖动一个网格到Hierarchy或者Scene视图中就可以将资它加到场景中。当你拖动一个网格到场景中,那么你就创建了一个网格渲染器组件的游戏项目。如果你操作的是一张纹理或者一个声音文件,如果你将它们添加到游戏项目中那么他们就已经存在与场景和项目中了。

Simply click and drag the mesh from theProject View to theHierarchy or Scene View to add it to theScene. When you drag a mesh to the scene, you are creating aGameObjectthat has a Mesh Renderer Component. If you are working with atexture or a sound file, you will have to add it to a GameObject that alreadyexists in the Scene or Project.

将不同的资源放到一起

Putting DifferentAssets Together

下面列出了一些常用资源的关系:

·        将纹理应用到材质

·        将材质应用到游戏项目(拥有一个网格渲染器组件)

·        将动画应用到游戏项目(拥有一个动画组件)

·        将声音文件应用到游戏项目(拥有一个声源组件)

Here is a brief description of therelationships between the most common assets

·        A Texture is applied to aMaterial

·        A Material is applied to a GameObject (with a MeshRenderer Component)

·        AnAnimation is applied to a GameObject (with anAnimation Component)

·        A sound file is applied to a GameObject (with anAudio Source Component)

创建一个Prefab

Creating a Prefab

Prefab是一些能够在你的场景中重复使用的游戏项目和组件。多个完全相同的项目能够通过同一个Prefab创建,这个方式被叫做实例化。使用树为例。创建一个树的Prefab将允许我们实例化多个完全相同的树到场景中不同的位置。这是应为,这些树都被连接到了同一个Prefab,改变这个Prefab将会自动的改变它所有的实例。所以,如果你希望改变网格,材质或者任何其它的东西,你只需要修改Prefab其它的所有实力就能过应用这个修改。通常情况下你也可以修改实力,并在主菜单中选择GameObject->ApplyChanges to Prefab。通过这种方式就能够减少在调整和更新资源时所浪费的时间。

Prefabs are a collection of GameObjects &Components that can be re-used in your scenes. Several identical objects can becreated from a single Prefab, called instancing. Take trees for example.Creating a tree Prefab will allow you to instance several identical trees andplace them in your scene. Because the trees are all linked to the Prefab, anychanges that are made to the Prefab will automatically be applied to all treeinstances. So if you want to change the mesh, material, or anything else, youjust make the change once in the Prefab and all the other trees inherit thechange. You can also make changes to an instance, and chooseGameObject->ApplyChanges to Prefab from the main menu. This can save you lots of time duringsetup and updating of assets.

当你的游戏项目包含了多个组件或者一个集成的子游戏项目,你可以为最高层的游戏项目(根节点)创建一个Prefab,那么你就可以重复使用这个游戏项目了。

When you have a GameObject that contains multipleComponents and a hierarchy of child GameObjects, you can make a Prefab of thetop-level GameObject (orroot), and re-use the entire collection ofGameObjects.

试想一下,如果Prefab是一个游戏项目的蓝图。所有的Prefab都克隆完全相同的东西到蓝图中。那么,如果这个蓝图发生了改变,所有的克隆也会改变。这一种不同的方式,通过更新Prefab的某一个蓝图就能够将这些改变应用倒蓝图中。单击此处查看更多关于于Prefab使用和更新的知识。

Think of a Prefab as a blueprint for a structure ofGameObjects. All the Prefab clones are identical to the blueprint. Therefore,if the blueprint is updated, so are all the clones. There are different waysyou can update the Prefab itself by changing one of its clones and applyingthose changes to the blueprint. To read more about using and updating Prefabs,please view thePrefabspage.

实际上,创建一个游戏项目Prefab到场景中,首先需要在Project视图中创建一个Prefab。并为你的Prefab取一个你喜欢的名字。然后,在场景中选择你希望创建Prefab的游戏项目,拖动它到新的Prefab,这样你就能看到你选择的游戏项目的名字变成了蓝色。这样你就创建了一个可重复使用的Prefab

To actually create a Prefab from a GameObject in yourscene, first create a new Prefab in your Project View. Name the new Prefabwhatever you like. Then, click on the Game Object in the scene that you want tomake into a Prefab. Drag it to the new Prefab, and you should see the GameObject's name text turn blue. You have now created a re-usable prefab.

更新资源

Updating Assets

你已经导入、实例化或者链接你的资源到一个Perfab。如果你需要编辑你的源资源,只需要在Project视图中双击它就可以了。一个用于编辑资源的文件将会被打开,通过它你能够更新你想要的编辑改资源。当你完成了对资源的更新,只需要保存它就可以了。这时,如果你选择了后面的Unity窗口,对资源所做的更新将会被检测到,资源也会被重新导入。资源所链接的Prefab也会被修改。所以,你将会看到你的Prefab也会被更新。这就是所有你需要知道的对于资源更新的内容。马上打开并保存它吧!

You have imported, instantiated, andlinked 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 willlaunch, 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 bemaintained. So the effect you will see is that your Prefab will update. That'sall you have to know to update assets. Just open it and save!

可选择添加的资源标签

Optional - AddingLabels to the Assets.

对你的资源加上标签是一个非常不错的习惯,这样能清晰的展示你的资源结构,这样你就可以通过标签在Project视图中和项目选择器中查询你的资源。

Is always a good idea to add labels toyour assets if you want to keep organized all your assets, with this you cansearch for the labels associated to each asset in the search field in theproject view or in the object selector.

为资源添加标签的步骤:

·        选择你希望添加标签的资源(在Project视图中选择)。

·        如果你还没有添加任何标签,在inspector中单击“Add Label”(图标)。

o   如果你已经添加了标签,只需要单击标签就可以了。

·        编辑你的标签

Steps for adding a label to an asset:

·        Select the asset you want to add the label to (From theproject view).

·        In the inspector click on the "Add Label" icon() if you dont have any Labels associatedto that asset.

o   If you have a label associated to an asset then justclick where the labels are.

·        Start writing your labels.

注意:

·        每个一个资源可以拥有多个标签

·        为了分隔或创建多个标签,只需要在编辑标签名字是单击空格或者回车。

Notes:

·        You can have more than one label for any asset.

·        To separate/create labels, just pressspace or enterwhen writing asset label names.

Page last updated: 2010-07-21

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值