Version: 2019.3
Building for Mobile / Consoles
Version Control

Prefabs

Note
To use Bolt, which is Unity’s visual scripting solution, you must purchase it on the Unity Asset Store.

Prefab Support

PrefabAn asset type that allows you to store a GameObject complete with components and properties. The prefab acts as a template from which you can create new object instances in the scene. More info
See in Glossary
Instance
Macro Embed
Created in editor
Instantiated at runtime

As this table indicates, there is full prefab support for every type of graph except for embed graph prefab instances created in the editor.

If you use a machine with an embed graph as a prefab, the edits you make on the prefab definition will not be automatically propagated to the prefab instances. Bolt will display warning messages in the inspector and in the graph window when you try to do this:

To avoid this, just remember this the rule of thumb:

Note: When adding a machine to a prefab, use a macro instead of an embed.

Prefab Overrides

Bolt uses a custom serialization engine, FullSerializer, instead of Unity’s default serialization. This is necessary because Unity’s serialization is extremely limited in terms of nesting, extensibility and coverage. For this reason, prefabs are handled a little differently.

One minor consequence of this you might notice in prefabs is that when bolding inspectorA Unity window that displays information about the currently selected GameObject, Asset or Project Settings, alowing you to inspect and edit the values. More info
See in Glossary
labels and values, it indicates differentiation rather than override. For example, an inspector field on a prefab instance will be never be bolded if it has the same value as the prefab definition, even if it has overridden this value.

Building for Mobile / Consoles
Version Control
Copyright © 2023 Unity Technologies
优美缔软件(上海)有限公司 版权所有
"Unity"、Unity 徽标及其他 Unity 商标是 Unity Technologies 或其附属机构在美国及其他地区的商标或注册商标。其他名称或品牌是其各自所有者的商标。
公安部备案号:
31010902002961