Class SpriteSkin
Deforms the Sprite that is currently assigned to the SpriteRenderer in the same GameObject
Implements
Inherited Members
Namespace: UnityEngine.U2D.Animation
Assembly: Unity.2D.Animation.Runtime.dll
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@7.0/manual/SpriteSkin.html")]
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 |
|---|---|
| bool |
autoRebind
Get and set the Auto Rebind property. When enabled, Sprite Skin attempts to automatically locate the Transform that is needed for the current Sprite assigned to the Sprite Renderer.
Declaration
public bool autoRebind { get; set; }
Property Value
| Type | Description |
|---|---|
| bool |
boneTransforms
Returns the Transform Components that are used for deformation. Do not modify elements of the returned array.
Declaration
public Transform[] boneTransforms { get; }
Property Value
| Type | Description |
|---|---|
| Transform[] |
rootBone
Returns the Transform Component that represents the root bone for deformation
Declaration
public Transform rootBone { get; }
Property Value
| Type | Description |
|---|---|
| Transform |
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 |
|---|---|
| bool | Returns true if this SpriteSkin has currently deformed vertices. Returns false otherwise. |
OnAfterDeserialize()
Called after object is deserialized.
Declaration
public void OnAfterDeserialize()
OnBeforeSerialize()
Called before object is serialized.
Declaration
public void OnBeforeSerialize()