---
title: 从纹理中剪切出 Sprites
product: Unity Editor
version: '6000.0'
latest_version: '7000.0'
status: This page documents version 6000.0. The latest version is 7000.0.
canonical: https://docs.unity.com/zh-cn/engine/6000.0/manual/unity2d/sprite/use-editor
latest_url: https://docs.unity.com/zh-cn/engine/7000.0/manual/unity2d/sprite/use-editor.md
last_updated: 2026-10-30
generated_at: 2026-11-16T19:26:16.618Z
locale: zh-cn
---

# 从纹理中剪切出 Sprites

> 要从纹理创建Sprites，请使用 精灵编辑器 窗口的默认 精灵编辑器 选项选项卡。

要从纹理中剪切精灵，请使用 **Sprite Editor** 窗口的默认**精灵编辑器**选项卡。

对于每个精灵，Unity 都会在 **Project** 窗口中创建精灵资源 () 作为纹理的子项。

## Open the 精灵编辑器##open-the-sprite-editor

请执行以下步骤：

1. 在 **Project** 窗口中，选择要编辑的纹理。

   > **Note:**
   >
   > 无法在 Editor View 中选择精灵来编辑精灵。

2. 在 Editor 窗口中，确保**纹理类型**设置为 **Sprite（2D 和 UI）**。

3. 选择 **精灵编辑器**。

## 调整 Single sprite 的面积##adjust-the-area-of-a-single-sprite

如果纹理的**精灵模式**设置为**单一**，则整个纹理为 Single sprite。要在 **Sprite Editor** 窗口中调整精灵，请执行以下步骤：

1. 选择纹理。Unity 显示一个矩形选择区域，其中在角上带有控制柄。这是 Sprite 区域，也称为 `SpriteRect`。
2. Drag蓝色手柄或边缘可设置Sprite的区域。
3. 使用 Editor 覆盖来配置精灵的 Properties。有关更多信息，请参阅[精灵编辑器选项卡参考](/engine/6000.0/manual/unity2d/sprite/sprite-editor-window-reference/reference.md#sprite-overlay)。
4. 要保存精灵，请在工具栏中选择 **Apply**。

## 从单一纹理中剪切出多个 Sprites##cut-out-multiple-sprites-from-a-single-texture

如果纹理的**精灵模式**设置为**多个**，则纹理可以包含多个Sprites。每个精灵由您在**精灵编辑器**窗口中创建的`SpriteRect`定义。

在**精灵编辑器**窗口中执行以下任一操作：

* 手动选择要使用Sprites的区域。
* 自动切片到 Sprites，例如从使用常规 Layout 或 Transparent 像素来分隔每个图像的精灵图集。

### 手动选择要使用Sprites的区域##manually-select-areas-to-use-as-sprites

请执行以下步骤：

1. 左键单击纹理并拖动以创建`SpriteRect`。
2. 重复步骤 1 以创建更多Sprites。
3. 要保存精灵，请在工具栏中选择 **Apply**。

### 自动切片到 Sprites##slice-into-sprites-automatically

要将纹理自动切片为多个Sprites，请选择工具栏中的 **Slice** Dropdown。

从以下切片方法中进行选择：

* **Automatic** 基于纹理的透明度进行切片。如果纹理中的每个图像都被Transparent像素分隔，请使使用此选项。
* **网格按单元格大小**，切成相同大小的Sprites。
* **Grid By Cell Count**，用于切成指定数量的行和列。
* **等距网格**，用于切成等距菱形Sprites而不是矩形Sprites。

当您选择 **Automatic** 以外的选项或调整 **Slice** 覆盖中的 Settings 时，Unity 将精灵的预览显示为红色 Outlines。如果您已经对纹理进行了 Sliced，Unity 可能不会显示 Outlines。

选择 **Slice** 以Apply the slicing method 后，要调整生成的精灵，请选择它，然后拖动其蓝色手柄或边缘。

有关更多信息，请参阅[精灵编辑器选项卡参考](/engine/6000.0/manual/unity2d/sprite/sprite-editor-window-reference/reference.md#slice-overlay)。

## 在应用或还原更改之前发出警告##warn-before-applying-or-reverting-changes

要使 Unity 在精灵编辑器中选择 **恢复**或**Apply** 时显示 Warning，请执行以下步骤：

1. 从主要菜单中选择 **Edit** > **偏好**。
2. 选择 **2D > 精灵编辑器 Window**。
3. 启用 **Show Apply confirmation** 或 **Show恢复确认**。

## 其他资源##additional-resources

* [精灵编辑器选项卡参考](/engine/6000.0/manual/unity2d/sprite/sprite-editor-window-reference/reference.md)
* [精灵资源参考](/engine/6000.0/manual/unity2d/sprite/class-sprite.md)
