docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class PSDImporter

    ScriptedImporter to import Photoshop files

    Inheritance
    object
    Object
    AssetImporter
    ScriptedImporter
    PSDImporter
    Implements
    ISpriteEditorDataProvider
    Inherited Members
    ScriptedImporter.SupportsRemappedAssetType(Type)
    AssetImporter.GetImportLog(string)
    AssetImporter.SetAssetBundleNameAndVariant(string, string)
    AssetImporter.GetAtPath(string)
    AssetImporter.SaveAndReimport()
    AssetImporter.AddRemap(AssetImporter.SourceAssetIdentifier, Object)
    AssetImporter.RemoveRemap(AssetImporter.SourceAssetIdentifier)
    AssetImporter.GetExternalObjectMap()
    AssetImporter.assetPath
    AssetImporter.importSettingsMissing
    AssetImporter.assetTimeStamp
    AssetImporter.userData
    AssetImporter.assetBundleName
    AssetImporter.assetBundleVariant
    Object.GetEntityId()
    Object.GetInstanceID()
    Object.GetHashCode()
    Object.Equals(object)
    Object.InstantiateAsync<T>(T)
    Object.InstantiateAsync<T>(T, Transform)
    Object.InstantiateAsync<T>(T, Vector3, Quaternion)
    Object.InstantiateAsync<T>(T, Transform, Vector3, Quaternion)
    Object.InstantiateAsync<T>(T, int)
    Object.InstantiateAsync<T>(T, int, Transform)
    Object.InstantiateAsync<T>(T, int, Vector3, Quaternion)
    Object.InstantiateAsync<T>(T, int, ReadOnlySpan<Vector3>, ReadOnlySpan<Quaternion>)
    Object.InstantiateAsync<T>(T, int, Transform, Vector3, Quaternion)
    Object.InstantiateAsync<T>(T, int, Transform, Vector3, Quaternion, CancellationToken)
    Object.InstantiateAsync<T>(T, int, Transform, ReadOnlySpan<Vector3>, ReadOnlySpan<Quaternion>)
    Object.InstantiateAsync<T>(T, int, Transform, ReadOnlySpan<Vector3>, ReadOnlySpan<Quaternion>, CancellationToken)
    Object.InstantiateAsync<T>(T, InstantiateParameters, CancellationToken)
    Object.InstantiateAsync<T>(T, int, InstantiateParameters, CancellationToken)
    Object.InstantiateAsync<T>(T, Vector3, Quaternion, InstantiateParameters, CancellationToken)
    Object.InstantiateAsync<T>(T, int, Vector3, Quaternion, InstantiateParameters, CancellationToken)
    Object.InstantiateAsync<T>(T, int, ReadOnlySpan<Vector3>, ReadOnlySpan<Quaternion>, InstantiateParameters, CancellationToken)
    Object.Instantiate(Object, Vector3, Quaternion)
    Object.Instantiate(Object, Vector3, Quaternion, Transform)
    Object.Instantiate(Object)
    Object.Instantiate(Object, Scene)
    Object.Instantiate<T>(T, InstantiateParameters)
    Object.Instantiate<T>(T, Vector3, Quaternion, InstantiateParameters)
    Object.Instantiate(Object, Transform)
    Object.Instantiate(Object, Transform, bool)
    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, bool)
    Object.Destroy(Object, float)
    Object.Destroy(Object)
    Object.DestroyImmediate(Object, bool)
    Object.DestroyImmediate(Object)
    Object.FindObjectsOfType(Type)
    Object.FindObjectsOfType(Type, bool)
    Object.FindObjectsByType(Type, FindObjectsSortMode)
    Object.FindObjectsByType(Type, FindObjectsInactive, FindObjectsSortMode)
    Object.DontDestroyOnLoad(Object)
    Object.DestroyObject(Object, float)
    Object.DestroyObject(Object)
    Object.FindSceneObjectsOfType(Type)
    Object.FindObjectsOfTypeIncludingAssets(Type)
    Object.FindObjectsOfType<T>()
    Object.FindObjectsByType<T>(FindObjectsSortMode)
    Object.FindObjectsOfType<T>(bool)
    Object.FindObjectsByType<T>(FindObjectsInactive, FindObjectsSortMode)
    Object.FindObjectOfType<T>()
    Object.FindObjectOfType<T>(bool)
    Object.FindFirstObjectByType<T>()
    Object.FindAnyObjectByType<T>()
    Object.FindFirstObjectByType<T>(FindObjectsInactive)
    Object.FindAnyObjectByType<T>(FindObjectsInactive)
    Object.FindObjectsOfTypeAll(Type)
    Object.FindObjectOfType(Type)
    Object.FindFirstObjectByType(Type)
    Object.FindAnyObjectByType(Type)
    Object.FindObjectOfType(Type, bool)
    Object.FindFirstObjectByType(Type, FindObjectsInactive)
    Object.FindAnyObjectByType(Type, FindObjectsInactive)
    Object.ToString()
    Object.name
    Object.hideFlags
    object.Equals(object, object)
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    Namespace: UnityEditor.U2D.PSD
    Assembly: Unity.2D.Psdimporter.Editor.dll
    Syntax
    [ScriptedImporter(23100002, new string[] { "psb" }, new string[] { "psd" }, AllowCaching = true)]
    [HelpURL("https://docs.unity3d.com/Packages/com.unity.2d.psdimporter@latest")]
    [MovedFrom("UnityEditor.Experimental.AssetImporters")]
    public class PSDImporter : ScriptedImporter, ISpriteEditorDataProvider

    Constructors

    PSDImporter()

    PSDImporter constructor.

    Declaration
    public PSDImporter()

    Properties

    anisoLevel

    Anisotropic filtering level of the texture.

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

    borderMipmap

    Keeps texture borders the same when generating mipmaps.

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

    fadeout

    Fades out mip levels to a gray color.

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

    filterMode

    Filtering mode of the texture.

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

    generateTileAssets

    Sets whether to generate Tile assets.

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

    isReadable

    Set this to true if you want texture data to be readable from scripts. Set it to false to prevent scripts from reading texture data.

    In order for Texture2D.GetPixel, Texture2D.GetPixels, ImageConversion.EncodeToEXR, ImageConversion.EncodeToJPG, ImageConversion.EncodeToPNG and similar functions to work, the Texture must be readable from scripts. The isReadable setting determines whether scripts can access texture data through these functions.

    Textures are not set as readable by default.

    When a Texture is not readable, it consumes much less memory because an uncompressed copy of the texture data in system memory is not required after the texture is uploaded to the graphics API. Readable Textures require an uncompressed system memory copy of the texture data so that once edited, the updated texture data can be uploaded to the graphics API.

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

    mipMapBias

    Mip map bias of the texture.

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

    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
    bool

    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
    bool

    mipmapFadeDistanceEnd

    Mip level where texture is faded out completely.

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

    mipmapFadeDistanceStart

    Mip level where texture begins to fade out.

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

    mipmapFilter

    Mip level where texture is faded out completely.

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

    mosiacPadding

    Sets the padding between each Sprites in the mosaic texture.

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

    secondarySpriteTextures

    Secondary textures for the imported Sprites.

    Declaration
    public SecondarySpriteTexture[] secondarySpriteTextures { get; set; }
    Property Value
    Type Description
    SecondarySpriteTexture[]

    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

    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
    float

    spriteSizeExpand

    Sets the value to increase the Sprite size by.

    Declaration
    public ushort spriteSizeExpand { get; set; }
    Property Value
    Type Description
    ushort

    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
    bool

    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
    int

    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.

    tilePaletteCellLayout

    Cell Layout for generated Tile Palette

    Declaration
    public GridLayout.CellLayout tilePaletteCellLayout { get; set; }
    Property Value
    Type Description
    GridLayout.CellLayout

    tilePaletteCellSize

    Cell Size for generated Tile Palette

    Declaration
    public Vector3 tilePaletteCellSize { get; set; }
    Property Value
    Type Description
    Vector3

    tilePaletteCellSizing

    Cell Sizing for generated Tile Palette

    Declaration
    public GridPalette.CellSizing tilePaletteCellSizing { get; set; }
    Property Value
    Type Description
    GridPalette.CellSizing

    tilePaletteHexagonLayout

    Hexagonal Layout for generated Tile Palette

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

    tileTemplate

    Tile Template for importing Tile Palette

    Declaration
    public TileTemplate tileTemplate { get; set; }
    Property Value
    Type Description
    TileTemplate

    transparencySortAxis

    Transparency Sort Axis for generated Tile Palette

    Declaration
    public Vector3 transparencySortAxis { get; set; }
    Property Value
    Type Description
    Vector3

    transparencySortMode

    Transparency Sort Mode for generated Tile Palette

    Declaration
    public TransparencySortMode transparencySortMode { get; set; }
    Property Value
    Type Description
    TransparencySortMode

    useCharacterMode

    Sets if importer should generate a prefab as sub-asset. To generate a Prefab useMosaicMode needs to be set to true and importer needs to be set to import Sprites in multiple mode.

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

    useMosaicMode

    Sets if importer should generate a mosaic texture from the source layers. To generate such texture, the importer needs to be set to import Sprites in multiple mode.

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

    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)

    Implementation of ScriptedImporter.OnImportAsset

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

    This argument contains all the contextual information needed to process the import event and is also used by the custom importer to store the resulting Unity Asset.

    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.

    Implements

    UnityEditor.U2D.Sprites.ISpriteEditorDataProvider
    In This Article
    Back to top
    Copyright © 2025 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)