功能亮点:改进了在Unity 2020.1中编辑预制件的工作流程

In Unity 2020.1, you can enter Prefab Mode without leaving the context of your scene. The new default means that when you open a Prefab Asset via an instance in the scene, you’ll be able to edit it with the background grayed out.

Unity 2020.1中 ,您可以在不离开场景上下文的情况下进入预制模式。 新的默认设置意味着,当您通过场景中的实例打开“预制资产”时,可以在背景为灰色的情况下对其进行编辑。

When we introduced Prefab Mode in Unity 2018.3, it became easy to edit a Prefab Asset in isolation. However, Prefab Mode has not been great for editing Prefab Assets in relation to the context the instances are in.

当我们在Unity 2018.3中引入预制模式时,可以轻松地独立编辑预制资产。 但是,Prefab Mode不适用于根据实例所在的上下文来编辑Prefab Assets。

In 2020.1 we’re introducing an improvement to the Prefabs workflow that we call Prefab Mode in Context. Like always in Prefab Mode, you’re editing the Prefab Asset itself, not an instance, but the context is visible at the same time. 

在2020.1中,我们对Prefabs工作流程进行了改进,我们称之为 Context中的Prefab Mode 。 像始终在“预制模式”下一样,您正在编辑“预制资产”本身,而不是实例,但是上下文同时可见。

演示地址

When you open a Prefab for editing in Prefab Mode in Context, the context is grayed out by default, but you can easily switch it to be fully visible or fully hidden too. Just use the Context: control in the Prefab bar to set it to any of the following states:

当您打开“预制”以在“上下文”中的“预制”模式下进行编辑时,默认情况下该上下文呈灰色,但是您也可以轻松地将其切换为完全可见或完全隐藏。 只需使用Prefab栏中的Context:控件将其设置为以下任一状态即可:

  • Normal – Shows the context with its normal colors

    正常 -以其正常颜色显示上下文

  • Gray – Shows the context in grayscale

    灰度 –以灰度显示上下文

  • Hidden – Hides the context entirely so only the Prefab content is visible

    隐藏 -完全隐藏上下文,因此仅可见Prefab内容

When you open a Prefab for editing in Prefab Mode in Context, we actually hide the Prefab instance from the Scene, and show the Prefab Asset contents in its place instead. This is how we make the Prefab Asset appear in the same position as the Prefab instance.

当您在上下文中以Prefab模式打开用于编辑的Prefab时,我们实际上从场景中隐藏了Prefab实例,而是在其位置显示Prefab Asset内容。 这就是我们使“预制资产”显示在与“预制”实例相同的位置上的方式。

预览Prefab实例中的替代 (Previewing overrides from the Prefab instance)

You can see that the position and rotation properties of the root Transform are disabled for editing. This is because the position and rotation have been temporarily patched to get the same values as the instance has, so the Prefab Asset appears in the right position in the world. It wouldn’t make sense to edit the values, since it’s not the Prefab’s own values, but just temporary values used for the visualization. If you DO need to edit the position or rotation of the root Transform, you can do that when opening the Prefab in isolation.

您可以看到禁用了根变换的位置和旋转属性进行编辑。 这是因为位置和旋转已被临时修补以获得与实例相同的值,所以“预制资产”在世界上的位置正确。 编辑值没有任何意义,因为它不是Prefab自己的值,而只是用于可视化的临时值。 如果您确实需要编辑根Transform的位置或旋转,则可以在单独打开Prefab时执行此操作。

Apart from the root Transform properties, a Prefab instance can have other properties overridden as well, which may drastically change its appearance compared to the Prefab Asset it’s an instance of. You can preview these overridden values from the Prefab instance while in Prefab Mode in Context by enabling the Show Overrides toggle in the Prefab bar.

除了根Transform属性之外,Prefab实例还可以具有其他属性,这些属性与其实例的Prefab Asset相比可能会发生巨大变化。 您可以在上下文的“预制”模式下通过启用 “预制”栏中 的“ 显示替代” 切换 来预览这些替代值 。

Properties that display overrides from the Prefab instance can’t be edited. The shown value is not the value the property actually has in the Prefab Asset – it’s just a temporary visualization. To be able to see and edit the Prefab’s own value for the property, you can turn off the Show Overrides toggle at any time.

显示来自Prefab实例的替代的属性无法编辑。 显示的值不是该属性在“预制资产”中实际具有的值-只是一个临时可视化。 为了能够查看和编辑该属性的Prefab自身值,您可以随时关闭“ 显示替代” 切换。

用于UI设计的上下文预制 (Prefabs in Context for UI design)

This new feature may be particularly useful for level design tasks and for UI (uGUI) work. It can be helpful for working with UI Prefabs because the parent RectTransform to the Prefab has the same size in Prefab Mode in Context as it does in the scene. This means that UI Prefabs keep the same size and appearance in Prefab Mode in Context as they have in the scene, helping designers have a better reference when they adjust the different elements that are part of that UI Prefab

对于级别设计任务和UI(uGUI)工作,此新功能可能特别有用。 这对于使用UI Prefabs可能会有所帮助,因为到上下文的父RectTransform在Prefab模式下的上下文大小与场景中的大小相同。 这意味着UI预制件在上下文中的“预制”模式下保持与场景中相同的大小和外观,从而有助于设计人员在调整UI预制中的不同元素时获得更好的参考。

Editing a child Prefab with the context of the parent UI window.

使用父UI窗口的上下文编辑子Prefab。

让我们知道您的想法 (Let us know what you think)

演示地址

Please read Editing a Prefab in Prefab Mode documentation for more details, and go to Editor and Team workflows in Unity 2020.1 page to discover more improvements like this.
We hope Prefab Mode in Context will be a useful tool in your Prefab editing workflows. We’re looking forward to hearing from you on our Prefabs forum!

请阅读 在预制模式文档中编辑预制以 获取更多详细信息,并转到 Unity 2020.1页面中的编辑器和团队工作流程 以发现更多类似的改进。
我们希望“上下文中的预制模式”将成为您在预制编辑工作流程中使用的有用工具。 我们希望在我们的 Prefabs论坛收到 您的 来信!

翻译自: https://blogs.unity3d.com/2020/08/11/feature-highlight-improved-workflows-for-editing-prefabs-in-unity-2020-1/

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

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值