Class IKChain2D
Class for storing data for a 2D IK Chain.
Inherited Members
Namespace: UnityEngine .U2D.IK
Assembly: Unity.2D.IK.Runtime.dll
Syntax
[MovedFrom("UnityEngine.Experimental.U2D.IK")]
[Serializable]
public class IKChain2D
Fields
m_Lengths
Array of lengths in the IK Chain.
Declaration
protected float[] m_Lengths
Field Value
Type | Description |
---|---|
float[] |
Properties
effector
Get and set the transform used as the IK Effector.
Declaration
public Transform effector { get; set; }
Property Value
Type | Description |
---|---|
Transform |
isValid
Returns true if the IK Chain is valid. False otherwise.
Declaration
public bool isValid { get; }
Property Value
Type | Description |
---|---|
bool |
lengths
Gets the length of the IK Chain.
Declaration
public float[] lengths { get; }
Property Value
Type | Description |
---|---|
float[] |
rootTransform
Get the root transform for the IK Chain.
Declaration
public Transform rootTransform { get; }
Property Value
Type | Description |
---|---|
Transform |
target
Get and set the transform used as the IK Target.
Declaration
public Transform target { get; set; }
Property Value
Type | Description |
---|---|
Transform |
transformCount
Get and Set the number of transforms in the IK Chain.
Declaration
public int transformCount { get; set; }
Property Value
Type | Description |
---|---|
int |
transforms
Get the transforms that are used in the IK Chain.
Declaration
public Transform[] transforms { get; }
Property Value
Type | Description |
---|---|
Transform[] |
Methods
BlendFkToIk(float, bool)
Blend between Forward Kinematics and Inverse Kinematics.
Declaration
public void BlendFkToIk(float finalWeight, bool targetRotationIsConstrained)
Parameters
Type | Name | Description |
---|---|---|
float | finalWeight | Weight for blend |
bool | targetRotationIsConstrained | True to constrain target rotation. False otherwise. |
Initialize()
Initialize the IK Chain.
Declaration
public void Initialize()
RestoreDefaultPose(bool)
Restores the IK Chain to it's default pose.
Declaration
public void RestoreDefaultPose(bool targetRotationIsConstrained)
Parameters
Type | Name | Description |
---|---|---|
bool | targetRotationIsConstrained | True to constrain the target rotation. False otherwise. |
StoreLocalRotations()
Explicitly stores the local rotation.
Declaration
public void StoreLocalRotations()