docs.unity3d.com
Search Results for

    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
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: UnityEditor
    Assembly: Unity.2D.Sprite.Editor.dll
    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
    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
    GUID

    GUID for the SpriteRect.

    In This Article
    Back to top
    Copyright © 2024 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)