Experimental: this API is experimental and might be changed or removed in the future.

ISpriteEditor

interface in UnityEditor.Experimental.U2D

Switch to Manual

Description

定义继承 SpriteEditorModuleBase 的类可使用功能的界面。

Sprite Editor 窗口用来封装编辑精灵数据时 Sprite Editor 模块可访问的功能。

Variables

editingDisabled指示是否应禁用精灵数据编辑功能;例如当编辑器处于播放模式时。
enableMouseMoveEvent指示 ISpriteEditor 是否应该关注鼠标移动事件。
selectedSpriteRect当前选择的精灵矩形数据。
spriteRects设置当前可用的精灵矩形。
windowDimension定义窗口当前屏幕位置和大小的属性。

Public Functions

ApplyOrRevertModification该方法将通知当前活跃的 SpriteEditorModuleBase,以应用或还原任何数据更改。
GetDataProvider获取当前选择的 Assets 导入器支持的数据提供程序。
GetMainVisualContainerReturns a VisualElement for attaching child VisualElement onto the main view of a ISpriteEditor.
HandleSpriteSelection该方法将根据当前的鼠标按下事件和可用的 ISpriteEditor.spriteRects 更新 ISpriteEditor.selectedSpriteRect。
RequestRepaint请求重绘当前视图。
SetDataModified指示数据发生了更改。在 Sprite Editor 窗口中,这将启用“Apply”或“Revert”按钮。
SetPreviewTextureSets a custom texture to be used by the ISpriteEditor during setup of the editing space.