public static Create ( |
||
texture | Texture from which to obtain the sprite graphic. | |
rect | Rectangular section of the texture to use for the sprite. | |
pivot | Vector2 | Sprite's pivot point relative to its graphic rectangle. |
pixelsPerUnit | [ | The number of pixels in the sprite that correspond to one unit in world space. |
extrude | [ | Amount by which the sprite mesh should be expanded outwards. |
meshType | [ | Controls the type of mesh generated for the sprite. |
border | [ | The border sizes of the sprite (X=left, Y=bottom, Z=right, W=top). |
Результат |
public static Sprite Create(Texture2D texture, Rect rect, Vector2 pivot, [DefaultValue("100.0f")] float pixelsPerUnit, [DefaultValue("0")] uint extrude, [DefaultValue("SpriteMeshType.Tight")] SpriteMeshType meshType, [DefaultValue("Vector4.zero")] Vector4 border)
{
return INTERNAL_CALL_Create(texture, ref rect, ref pivot, pixelsPerUnit, extrude, meshType, ref border);
}
Sprite::Create ( |
|
Sprite::Create ( |
|
Sprite::Create ( |
|
Sprite::Create ( |
public override object Revert(BinaryReader reader) { var type = reader.ReadByte(); if (type == 0) { return(DeserializeUnityAsset(typeof(Sprite), reader)); } if (type == 1) { Texture2D texture = null; var rect = default(Rect); var pivot = default(Vector2); var pixelsPerUnit = 100f; var border = default(Vector4); Deserialize(reader, ret => texture = (Texture2D)ret); Deserialize(reader, ret => rect = (Rect)ret); Deserialize(reader, ret => pivot = (Vector2)ret); pixelsPerUnit = reader.ReadSingle(); Deserialize(reader, ret => border = (Vector4)ret); return(Sprite.Create(texture, rect, pivot, pixelsPerUnit, 0, SpriteMeshType.Tight, border)); } throw new NotSupportedException("Invalid type: " + type); }