docs.unity.cn
    Show / Hide Table of Contents

    Class SpriteRect

    Abstract class that is used by systems to encapsulate Sprite data representation. Currently this is used by Sprite Editor Window.

    Inheritance
    Object
    SpriteRect
    Namespace: UnityEditor
    Syntax
    [Serializable]
    public class SpriteRect

    Properties

    alignment

    SpriteAlignment that represents the pivot value for the Sprite data.

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

    border

    Returns a Vector4 that represents the border of the Sprite data.

    Declaration
    public Vector4 border { get; set; }
    Property Value
    Type Description
    Vector4

    name

    Declaration
    public string name { get; set; }
    Property Value
    Type Description
    String

    pivot

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

    rect

    Declaration
    public Rect rect { get; set; }
    Property Value
    Type Description
    Rect

    spriteID

    Declaration
    public GUID spriteID { get; set; }
    Property Value
    Type Description
    UnityEditor.GUID

    Methods

    GetSpriteIDFromSerializedProperty(SerializedProperty)

    Helper method to get SpriteRect.spriteID from a SerializedProperty.

    Declaration
    public static GUID GetSpriteIDFromSerializedProperty(SerializedProperty sp)
    Parameters
    Type Name Description
    SerializedProperty sp

    The SerializedProperty to acquire from.

    Returns
    Type Description
    UnityEditor.GUID

    GUID for the SpriteRect.

    Back to top Copyright © 2022 Unity Technologies
    Generated by DocFX
    on 09 May 2022
    Terms of use