holopy3/Assets/Plugins/RootMotion/FinalIK/Tools/EditorIK.cs
2020-12-10 15:25:12 +01:00

32 lines
No EOL
644 B
C#

using UnityEngine;
using System.Collections;
namespace RootMotion.FinalIK
{
/// <summary>
/// Updates any Final IK component in Editor mode
/// </summary>
[ExecuteInEditMode]
public class EditorIK : MonoBehaviour
{
private IK ik;
void Start()
{
ik = GetComponent<IK>();
ik.GetIKSolver().Initiate(ik.transform);
}
void Update()
{
if (ik == null) return;
if (ik.fixTransforms) ik.GetIKSolver().FixTransforms();
// Apply animation here if necessary
ik.GetIKSolver().Update();
}
}
}