Version: 2018.1
Preferencias
Build Settings

Presets

Use Presets to reuse property settings across multiple components and assets.

With Presets you can also specify default settings for new components and the import settings for assets. Use the Preset Manager to view and choose the Presets to use for default settings.

Use Presets to streamline your team’s workflows. You can even use Presets to specify settings for Settings Managers, including the Preset Manager itself. Use this feature to configure a project then export it as a custom package. Your team members can import this package into their projects.

Presets are an Editor-only feature. You can support Presets in your extensions to the Unity Editor. Presets are not available at run time in the Unity Player.

Reusing property settings

You use Presets like copying and pasting. But instead of copying settings to the clipboard, you save them to use later. And like pasting settings, applying a Preset to an item changes the properties in the item.

For example, select a GameObject to edit the properties of its RigidBody component. Save these settings to a Preset. Then apply the Preset to RigidBody components in other GameObjects. The other components in the GameObjects are not affected; the Preset only applies its settings to the RigidBody component.

You can store Presets in the Assets folder of your project. Use the Project window to view and select Presets to edit in the Inspector.

Example of Preset assets in the Project window, organized in a Presets sub-folder
Example of Preset assets in the Project window, organized in a Presets sub-folder

Saving property settings to a Preset

Use the Select Preset window to save property settings.

Tip: You can also save a Preset while in Play Mode.

To save settings to a Preset:

  1. Select the GameObject, asset import settings, or Settings Manager from which you want to reuse settings.

  2. In the Inspector window, edit the properties.

  3. Click the Preset icon at the top-right of the Inspector window.

  4. In the Select Preset window, click Save current to.

    A File Save dialog appears.

  5. Choose the location of your new Preset, enter its name, and click Save.

Applying a Preset

Apply a saved Preset with the Select Preset window or by dragging and dropping a Preset from the Project window onto the GameObject.

Note: Applying a Preset copies properties from the Preset to the item. It doesn’t link the Preset to the item. Changes you make to the Preset do not affect the items you have previously applied the Preset to.

To apply a Preset to a Settings Manager, an existing component, or import settings for an asset:

  1. Select the Settings Manager, GameObject, or asset import settings that you want to apply a Preset to.

  2. In the Inspector, click the Preset icon.

  3. In the Select Preset window, search for and select the Preset to apply.

    Selecting the Preset applies it to the component, asset, or Settings Manager.

  4. Close the Select Preset window.

Drag and drop a Preset from the Project window to apply properties to a component in a GameObject:

  • Drop the Preset on an empty spot in the Hierarchy window. Unity creates a new, empty GameObject and adds a component with properties copied from the Preset.

  • Drop the Preset on an existing GameObject in the Hierarchy. Unity adds a new component and copies properties from the Preset.

  • Drop the Preset on the Inspector window at the end of a GameObject. Unity adds a new component and copies properties from the Preset.

  • Drop the Preset on the Inspector onto the title of an existing component. Unity copies properties from the Preset.

Using Presets for transitions of Animation State nodes

You can save and apply Presets for Animation State nodes. However, the transitions in the Preset are shared among Presets and the nodes that you apply the Preset to. For example, you apply a Preset to two different nodes in the Animator Window. In the Inspector window, you edit the settings for one of the transitions in the first node. Your change also appears in the other node and in the Preset.

Using Presets for importing assets

You can save Presets for asset import settings. However, applying a Preset to import settings does not affect the cross-platform settings. To apply a Preset so that it includes cross-platform settings, set the Preset as a default then use the Reset command.

You can also use a script to apply a Preset to an asset based on the location of the asset in the Project window.

Editing a Preset

Use the Inspector window to edit a Preset asset.

Note: Changing the properties in a Preset does not update the items that you applied the Preset to. For example, if you apply a Preset for a RigidBody component to a GameObject, then edit the Preset, the settings in the RigidBody component do not change.

Editing a Preset in the Inspector window
Editing a Preset in the Inspector window

2017–03–27 Page published with limited editorial review

New feature in 2018.1 NewIn20181

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