Class SpriteRect
Abstract class that is used by systems to encapsulate Sprite data representation. Currently this is used by Sprite Editor Window.
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
border
Returns a Vector4 that represents the border of the Sprite data.
Declaration
public Vector4 border { get; set; }
Property Value
name
Declaration
public string name { get; set; }
Property Value
pivot
Declaration
public Vector2 pivot { get; set; }
Property Value
rect
Declaration
public Rect rect { get; set; }
Property Value
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
Returns
Type |
Description |
UnityEditor.GUID |
GUID for the SpriteRect.
|