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

ISpriteEditor

interface in UnityEditor.Experimental.U2D

Switch to Manual

Description

Interface that defines the functionality available for classes that inherits SpriteEditorModuleBase.

Used by Sprite Editor Window to encapsulate functionality accessible for Sprite Editor modules when editing Sprite data.

Variables

editingDisabledIndicates that if Sprite data editing should be disabled; for example when the Editor is in Play Mode.
enableMouseMoveEventIndicates if ISpriteEditor should be interested in mouse move events.
selectedSpriteRectThe current selected Sprite rect data.
spriteRectsSets current available Sprite rects.
windowDimensionProperty that defines the window's current screen position and size.

Public Functions

ApplyOrRevertModificationThe method will inform current active SpriteEditorModuleBase to apply or revert any data changes.
GetDataProviderGets data provider that is supported by the current selected Assets's importer.
GetMainVisualContainerReturns a VisualElement for attaching child VisualElement onto the main view of a ISpriteEditor.
HandleSpriteSelectionThe method updates ISpriteEditor.selectedSpriteRect based on current mouse down event and ISpriteEditor.spriteRects available.
RequestRepaintRequest to repaint the current view.
SetDataModifiedIndicates that there has been a change of data. In Sprite Editor Window, this enables the 'Apply' and 'Revert' button.
SetPreviewTextureSets a custom texture to be used by the ISpriteEditor during setup of the editing space.