Version: 2023.2
Removing an installed package from a project
切换到另一个包版本

禁用内置包

You can disable a Built-in package if you don’t need some modules and you want to save resources. However, when you disable a built-in package, the corresponding Unity functionality is no longer available.

Disabling a built-in package results in the following:

  • 如果使用由某个禁用的包实现的脚本 API,则会遇到编译器错误。
  • Components implemented by the disabled built-in package are also disabled, which means you can’t add them to any GameObjects. If you have a GameObject that already has one of these components, Unity ignores them in Play mode. You can view them in the Inspector window but they’re grayed out to indicate that they’re not available.
  • When building a game, Unity strips all disabled components. For build targets which support engine code stripping (like Web, iOS, and Android), Unity doesn’t add any code from a disabled built-in package.

要禁用内置包,请执行以下操作:

  1. Open the Package Manager window select Built-in packages from the navigation panel.

    Switch the list context to Built-in packages
    Switch the list context to Built-in packages
  2. Select the built-in package you want to disable. Its information appears in the details panel.

  3. Click Disable.

    Disable button in the corner of the details panel
    Disable button in the corner of the details panel

    进度条结束后,内置包旁边不再出现复选标记,Disable 按钮变为 Enable 按钮。

  4. 如果要重新启用已禁用的内置包,请单击 Enable 按钮。

Note: You can disable multiple built-in packages with one click by using the multiple select feature. For more information, refer Perform an action on multiple packages or feature sets.

Removing an installed package from a project
切换到另一个包版本