docs.unity3d.com
    Show / Hide Table of Contents

    Class AsepriteImporter

    ScriptedImporter to import Aseprite files

    Inheritance
    Object
    Object
    AssetImporter
    ScriptedImporter
    AsepriteImporter
    Inherited Members
    AssetImporter.SetAssetBundleNameAndVariant(String, String)
    AssetImporter.GetAtPath(String)
    AssetImporter.SaveAndReimport()
    UnityEditor.AssetImporter.AddRemap(UnityEditor.AssetImporter.SourceAssetIdentifier, UnityEngine.Object)
    UnityEditor.AssetImporter.RemoveRemap(UnityEditor.AssetImporter.SourceAssetIdentifier)
    AssetImporter.GetExternalObjectMap()
    AssetImporter.assetPath
    AssetImporter.importSettingsMissing
    UnityEditor.AssetImporter.assetTimeStamp
    AssetImporter.userData
    AssetImporter.assetBundleName
    AssetImporter.assetBundleVariant
    Object.GetInstanceID()
    Object.GetHashCode()
    Object.Equals(Object)
    Object.Instantiate(Object, Vector3, Quaternion)
    Object.Instantiate(Object, Vector3, Quaternion, Transform)
    Object.Instantiate(Object)
    Object.Instantiate(Object, Transform)
    Object.Instantiate(Object, Transform, Boolean)
    Object.Instantiate<T>(T)
    Object.Instantiate<T>(T, Vector3, Quaternion)
    Object.Instantiate<T>(T, Vector3, Quaternion, Transform)
    Object.Instantiate<T>(T, Transform)
    Object.Instantiate<T>(T, Transform, Boolean)
    Object.Destroy(Object, Single)
    Object.Destroy(Object)
    Object.DestroyImmediate(Object, Boolean)
    Object.DestroyImmediate(Object)
    Object.FindObjectsOfType(Type)
    Object.FindObjectsOfType(Type, Boolean)
    Object.FindObjectsByType(Type, FindObjectsSortMode)
    Object.FindObjectsByType(Type, FindObjectsInactive, FindObjectsSortMode)
    Object.DontDestroyOnLoad(Object)
    Object.DestroyObject(Object, Single)
    Object.DestroyObject(Object)
    Object.FindSceneObjectsOfType(Type)
    Object.FindObjectsOfTypeIncludingAssets(Type)
    Object.FindObjectsOfType<T>()
    UnityEngine.Object.FindObjectsByType<T>(UnityEngine.FindObjectsSortMode)
    UnityEngine.Object.FindObjectsOfType<T>(System.Boolean)
    UnityEngine.Object.FindObjectsByType<T>(UnityEngine.FindObjectsInactive, UnityEngine.FindObjectsSortMode)
    Object.FindObjectOfType<T>()
    UnityEngine.Object.FindObjectOfType<T>(System.Boolean)
    UnityEngine.Object.FindFirstObjectByType<T>()
    UnityEngine.Object.FindAnyObjectByType<T>()
    UnityEngine.Object.FindFirstObjectByType<T>(UnityEngine.FindObjectsInactive)
    UnityEngine.Object.FindAnyObjectByType<T>(UnityEngine.FindObjectsInactive)
    Object.FindObjectsOfTypeAll(Type)
    Object.FindObjectOfType(Type)
    Object.FindFirstObjectByType(Type)
    Object.FindAnyObjectByType(Type)
    Object.FindObjectOfType(Type, Boolean)
    Object.FindFirstObjectByType(Type, FindObjectsInactive)
    Object.FindAnyObjectByType(Type, FindObjectsInactive)
    Object.ToString()
    Object.name
    Object.hideFlags
    Object.Equals(Object, Object)
    Object.ReferenceEquals(Object, Object)
    Object.GetType()
    Object.MemberwiseClone()
    Namespace: UnityEditor.U2D.Aseprite
    Syntax
    [ScriptedImporter(21300002, new string[]{"aseprite", "ase"}, AllowCaching = true)]
    [HelpURL("https://docs.unity3d.com/Packages/com.unity.2d.aseprite@latest")]
    public class AsepriteImporter : ScriptedImporter, ISpriteEditorDataProvider

    Properties

    addSortingGroup

    Add a Sorting Group component to the root of the generated model prefab if it has more than one Sprite Renderer.

    Declaration
    public bool addSortingGroup { get; set; }
    Property Value
    Type Description
    Boolean

    aniso

    Anisotropic filtering level of the texture.

    Declaration
    public int aniso { get; set; }
    Property Value
    Type Description
    Int32

    asepriteFile

    A parsed representation of the Aseprite file.

    Declaration
    public AsepriteFile asepriteFile { get; }
    Property Value
    Type Description
    AsepriteFile

    canvasSize

    The canvas size of the source file.

    Declaration
    public Vector2 canvasSize { get; }
    Property Value
    Type Description
    Vector2

    customPivotPosition

    Normalized position of the custom pivot.

    Declaration
    public Vector2 customPivotPosition { get; set; }
    Property Value
    Type Description
    Vector2

    filterMode

    Filtering mode of the texture.

    Declaration
    public FilterMode filterMode { get; set; }
    Property Value
    Type Description
    FilterMode

    generateAnimationClips

    Generate Animation Clips based on the frame data of the source asset.

    Declaration
    public bool generateAnimationClips { get; set; }
    Property Value
    Type Description
    Boolean

    generateModelPrefab

    Generate a Model Prefab based on the layers of the source asset.

    Declaration
    public bool generateModelPrefab { get; set; }
    Property Value
    Type Description
    Boolean

    importMode

    How the file should be imported.

    Declaration
    public FileImportModes importMode { get; set; }
    Property Value
    Type Description
    FileImportModes

    includeHiddenLayers

    Should include hidden layers from the source file.

    Declaration
    public bool includeHiddenLayers { get; set; }
    Property Value
    Type Description
    Boolean

    layerImportMode

    The import mode for all layers in the file.

    Declaration
    public LayerImportModes layerImportMode { get; set; }
    Property Value
    Type Description
    LayerImportModes

    mipMapBias

    Mip map bias of the texture.

    Declaration
    public float mipMapBias { get; set; }
    Property Value
    Type Description
    Single

    mipmapEnabled

    Generate Mip Maps.

    Select this to enable mip-map generation. Mipmaps are smaller versions of the Texture that get used when the Texture is very small on screen.

    Declaration
    public bool mipmapEnabled { get; set; }
    Property Value
    Type Description
    Boolean

    mipmapFadeDistanceEnd

    Mip level where texture is faded out completely.

    Declaration
    public int mipmapFadeDistanceEnd { get; set; }
    Property Value
    Type Description
    Int32

    mipmapFadeDistanceStart

    Mip level where texture begins to fade out.

    Declaration
    public int mipmapFadeDistanceStart { get; set; }
    Property Value
    Type Description
    Int32

    mipmapFilter

    Mip level where texture is faded out completely.

    Declaration
    public TextureImporterMipFilter mipmapFilter { get; set; }
    Property Value
    Type Description
    TextureImporterMipFilter

    mipMapsPreserveCoverage

    Enables or disables coverage-preserving alpha mipmapping.

    Enable this to rescale the alpha values of computed mipmaps so coverage is preserved. This means a higher percentage of pixels passes the alpha test and lower mipmap levels do not become more transparent. This is disabled by default (set to false).

    Declaration
    public bool mipMapsPreserveCoverage { get; set; }
    Property Value
    Type Description
    Boolean

    OnPostAsepriteImport

    Event that is fired at the last step of the Aseprite import process.

    Declaration
    public AsepriteImporter.AsepriteImportEventHandler OnPostAsepriteImport { get; set; }
    Property Value
    Type Description
    AsepriteImporter.AsepriteImportEventHandler

    pivotAlignment

    How a Sprite's graphic rectangle is aligned with its pivot point.

    Declaration
    public SpriteAlignment pivotAlignment { get; set; }
    Property Value
    Type Description
    SpriteAlignment

    pivotSpace

    The space the Sprite pivots are being calculated.

    Declaration
    public PivotSpaces pivotSpace { get; set; }
    Property Value
    Type Description
    PivotSpaces

    spriteExtrude

    The number of blank pixels to leave between the edge of the graphic and the mesh.

    Declaration
    public uint spriteExtrude { get; set; }
    Property Value
    Type Description
    UInt32

    spriteImportMode

    Selects Single or Manual import mode for Sprite textures.

    Declaration
    public SpriteImportMode spriteImportMode { get; set; }
    Property Value
    Type Description
    SpriteImportMode

    Valid values are SpriteImportMode.Multiple or SpriteImportMode.Single.

    Exceptions
    Type Condition
    ArgumentException

    Exception when non valid values are set.

    spriteMeshType

    Sets the type of mesh to ge generated for each Sprites.

    Declaration
    public SpriteMeshType spriteMeshType { get; set; }
    Property Value
    Type Description
    SpriteMeshType

    spritePadding

    Internal padding within each SpriteRect generated from the Aseprite file.

    Declaration
    public uint spritePadding { get; set; }
    Property Value
    Type Description
    UInt32

    spritePixelsPerUnit

    The number of pixels in the sprite that correspond to one unit in world space.

    Declaration
    public float spritePixelsPerUnit { get; set; }
    Property Value
    Type Description
    Single

    streamingMipmaps

    Enable mipmap streaming for the texture.

    Only load larger mipmaps as needed to render the current game cameras. Requires texture streaming to be enabled in quality settings.

    Declaration
    public bool streamingMipmaps { get; set; }
    Property Value
    Type Description
    Boolean

    streamingMipmapsPriority

    Mipmap streaming priority when there's contention for resources. Positive numbers represent higher priority. Valid range is -128 to 127.

    Declaration
    public int streamingMipmapsPriority { get; set; }
    Property Value
    Type Description
    Int32

    textureType

    Which type of texture are we dealing with here.

    Declaration
    public TextureImporterType textureType { get; set; }
    Property Value
    Type Description
    TextureImporterType

    Valid values are TextureImporterType.Default or TextureImporterType.Sprite.

    Exceptions
    Type Condition
    ArgumentException

    Exception when non valid values are set.

    wrapMode

    Texture coordinate wrapping mode.

    Using wrapMode sets the same wrapping mode on all axes. Different per-axis wrap modes can be set using wrapModeU, wrapModeV, wrapModeW. Querying the value returns the U axis wrap mode (same as wrapModeU getter).

    Declaration
    public TextureWrapMode wrapMode { get; set; }
    Property Value
    Type Description
    TextureWrapMode

    wrapModeU

    Texture U coordinate wrapping mode.

    Controls wrapping mode along texture U (horizontal) axis.

    Declaration
    public TextureWrapMode wrapModeU { get; set; }
    Property Value
    Type Description
    TextureWrapMode

    wrapModeV

    Texture V coordinate wrapping mode.

    Controls wrapping mode along texture V (vertical) axis.

    Declaration
    public TextureWrapMode wrapModeV { get; set; }
    Property Value
    Type Description
    TextureWrapMode

    wrapModeW

    Texture W coordinate wrapping mode for Texture3D.

    Controls wrapping mode along texture W (depth, only relevant for Texture3D) axis.

    Declaration
    public TextureWrapMode wrapModeW { get; set; }
    Property Value
    Type Description
    TextureWrapMode

    Methods

    GetImporterPlatformSettings(BuildTarget)

    Retrieves the platform settings used by the importer for a given build target.

    Declaration
    public TextureImporterPlatformSettings GetImporterPlatformSettings(BuildTarget buildTarget)
    Parameters
    Type Name Description
    BuildTarget buildTarget

    The build target to query.

    Returns
    Type Description
    TextureImporterPlatformSettings

    TextureImporterPlatformSettings used for importing the texture for the build target.

    OnImportAsset(AssetImportContext)

    Declaration
    public override void OnImportAsset(AssetImportContext ctx)
    Parameters
    Type Name Description
    AssetImportContext ctx
    Overrides
    ScriptedImporter.OnImportAsset(AssetImportContext)

    SetImporterPlatformSettings(TextureImporterPlatformSettings)

    Sets the platform settings used by the importer for a given build target.

    Declaration
    public void SetImporterPlatformSettings(TextureImporterPlatformSettings setting)
    Parameters
    Type Name Description
    TextureImporterPlatformSettings setting

    TextureImporterPlatformSettings to be used by the importer for the build target indicated by TextureImporterPlatformSettings.

    SupportsRemappedAssetType(Type)

    Declaration
    public override bool SupportsRemappedAssetType(Type type)
    Parameters
    Type Name Description
    Type type
    Returns
    Type Description
    Boolean
    Overrides
    ScriptedImporter.SupportsRemappedAssetType(Type)

    Explicit Interface Implementations

    ISpriteEditorDataProvider.Apply()

    Implementation for ISpriteEditorDataProvider.Apply.

    Declaration
    void ISpriteEditorDataProvider.Apply()
    Implements
    ISpriteEditorDataProvider.Apply()

    ISpriteEditorDataProvider.GetDataProvider<T>()

    Implementation for ISpriteEditorDataProvider.GetDataProvider.

    Declaration
    T ISpriteEditorDataProvider.GetDataProvider<T>()
        where T : class
    Returns
    Type Description
    T
    Type Parameters
    Name Description
    T

    Data provider type to retrieve.

    Implements
    ISpriteEditorDataProvider.GetDataProvider<T>()

    ISpriteEditorDataProvider.GetSpriteRects()

    Implementation for ISpriteEditorDataProvider.GetSpriteRects.

    Declaration
    SpriteRect[] ISpriteEditorDataProvider.GetSpriteRects()
    Returns
    Type Description
    SpriteRect[]

    An array of SpriteRect for the current import mode.

    Implements
    ISpriteEditorDataProvider.GetSpriteRects()

    ISpriteEditorDataProvider.HasDataProvider(Type)

    Implementation for ISpriteEditorDataProvider.HasDataProvider.

    Declaration
    bool ISpriteEditorDataProvider.HasDataProvider(Type type)
    Parameters
    Type Name Description
    Type type

    Data provider type to query.

    Returns
    Type Description
    Boolean

    True if data provider is supported, false otherwise.

    Implements
    ISpriteEditorDataProvider.HasDataProvider(Type)

    ISpriteEditorDataProvider.InitSpriteEditorDataProvider()

    Implementation for ISpriteEditorDataProvider.InitSpriteEditorDataProvider.

    Declaration
    void ISpriteEditorDataProvider.InitSpriteEditorDataProvider()
    Implements
    ISpriteEditorDataProvider.InitSpriteEditorDataProvider()

    ISpriteEditorDataProvider.pixelsPerUnit

    Implementation for ISpriteEditorDataProvider.pixelsPerUnit.

    Declaration
    float ISpriteEditorDataProvider.pixelsPerUnit { get; }
    Returns
    Type Description
    Single
    Implements
    ISpriteEditorDataProvider.pixelsPerUnit

    ISpriteEditorDataProvider.SetSpriteRects(SpriteRect[])

    Implementation for ISpriteEditorDataProvider.SetSpriteRects.

    Declaration
    void ISpriteEditorDataProvider.SetSpriteRects(SpriteRect[] spriteRects)
    Parameters
    Type Name Description
    SpriteRect[] spriteRects

    Set the SpriteRect data for the current import mode.

    Implements
    ISpriteEditorDataProvider.SetSpriteRects(SpriteRect[])
    Back to top
    Copyright © 2023 Unity Technologies — Terms of use
    • Legal
    • Privacy Policy
    • Cookies
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)
    "Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
    Generated by DocFX on 18 October 2023