Class SpriteRect
Abstract class that is used by systems to encapsulate Sprite data representation. Currently this is used by Sprite Editor Window.
Inherited Members
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 |
---|---|
Sprite |
border
Returns a Vector4 that represents the border of the Sprite data.
Declaration
public Vector4 border { get; set; }
Property Value
Type | Description |
---|---|
Vector4 |
customData
Gets and sets the custom sprite data.
Declaration
public string customData { get; set; }
Property Value
Type | Description |
---|---|
string |
name
The name of the Sprite data.
Declaration
public string name { get; set; }
Property Value
Type | Description |
---|---|
string |
pivot
Vector2value representing the pivot for the Sprite data.
Declaration
public Vector2 pivot { get; set; }
Property Value
Type | Description |
---|---|
Vector2 |
rect
Rect value that represents the position and size of the Sprite data.
Declaration
public Rect rect { get; set; }
Property Value
Type | Description |
---|---|
Rect |
spriteID
GUID to uniquely identify the SpriteRect data. This will be populated to Sprite.spriteID to identify the SpriteRect used to generate the Sprite.
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 |
---|---|---|
Serialized |
sp | The SerializedProperty to acquire from. |
Returns
Type | Description |
---|---|
GUID | GUID for the SpriteRect. |