Class SpriteSkin
Deforms the Sprite that is currently assigned to the SpriteRenderer in the same GameObject
Inherited Members
Namespace: UnityEngine.U2D.Animation
Syntax
[Preserve]
[ExecuteInEditMode]
[DefaultExecutionOrder(-1)]
[DisallowMultipleComponent]
[RequireComponent(typeof(SpriteRenderer))]
[AddComponentMenu("2D Animation/Sprite Skin")]
[MovedFrom("UnityEngine.U2D.Experimental.Animation")]
[HelpURL("https://docs.unity3d.com/Packages/com.unity.2d.animation@4.2/manual/index.html#sprite-skin-component")]
public sealed class SpriteSkin : MonoBehaviour, ISerializationCallbackReceiver
Properties
alwaysUpdate
Determines if the SpriteSkin executes even if the associated SpriteRenderer has been culled from view.
Declaration
public bool alwaysUpdate { get; set; }
Property Value
Type | Description |
---|---|
Boolean |
boneTransforms
Returns the Transform Components that is used for deformation
Declaration
public Transform[] boneTransforms { get; }
Property Value
Type | Description |
---|---|
Transform[] | An array of Transform Components |
rootBone
Returns the Transform Component that represents the root bone for deformation
Declaration
public Transform rootBone { get; }
Property Value
Type | Description |
---|---|
Transform | A Transform Component |
Methods
GetDeformedVertexPositionData()
Gets an enumerable to iterate through all deformed vertex positions of this SpriteSkin.
Declaration
public IEnumerable<Vector3> GetDeformedVertexPositionData()
Returns
Type | Description |
---|---|
IEnumerable<Vector3> | Returns an IEnumerable to deformed vertex positions. |
Exceptions
Type | Condition |
---|---|
InvalidOperationException | Thrown when there is no vertex positions or deformed vertices. |
GetDeformedVertexTangentData()
Gets an enumerable to iterate through all deformed vertex tangents of this SpriteSkin.
Declaration
public IEnumerable<Vector4> GetDeformedVertexTangentData()
Returns
Type | Description |
---|---|
IEnumerable<Vector4> | Returns an IEnumerable to deformed vertex tangents. |
Exceptions
Type | Condition |
---|---|
InvalidOperationException | Thrown when there is no vertex tangents or deformed vertices. |
HasCurrentDeformedVertices()
Returns whether this SpriteSkin has currently deformed vertices.
Declaration
public bool HasCurrentDeformedVertices()
Returns
Type | Description |
---|---|
Boolean | Returns true if this SpriteSkin has currently deformed vertices. Returns false otherwise. |
OnAfterDeserialize()
Declaration
public void OnAfterDeserialize()
Implements
OnBeforeSerialize()
Declaration
public void OnBeforeSerialize()