Add IK Control For Pose Mode
This commit is contained in:
@@ -1,4 +1,7 @@
|
||||
using Newtonsoft.Json;
|
||||
using RootMotion;
|
||||
using RootMotion.Dynamics;
|
||||
using RootMotion.FinalIK;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
@@ -35,6 +38,8 @@ public class PoseManager : MonoBehaviour
|
||||
public GameObject HandleCanvas;
|
||||
public GameObject HelpPanel;
|
||||
|
||||
public FullBodyBipedIK PoseIK;
|
||||
|
||||
private void Update()
|
||||
{
|
||||
if (Input.GetKeyDown(KeyCode.H))
|
||||
@@ -115,8 +120,9 @@ public class PoseManager : MonoBehaviour
|
||||
ui.SetDynamicBoneEnable(false);
|
||||
HandleCanvas.SetActive(true);
|
||||
|
||||
if (builder.CurrentUMAContainer != null && builder.CurrentUMAContainer.UmaAnimator != null)
|
||||
if (builder.CurrentUMAContainer && builder.CurrentUMAContainer.UmaAnimator)
|
||||
{
|
||||
PoseIK = builder.CurrentUMAContainer.CreatePoseIK();
|
||||
builder.CurrentUMAContainer.UmaAnimator.enabled = false;
|
||||
}
|
||||
|
||||
@@ -140,6 +146,11 @@ public class PoseManager : MonoBehaviour
|
||||
builder.CurrentUMAContainer.UmaAnimator.enabled = true;
|
||||
}
|
||||
|
||||
if (PoseIK)
|
||||
{
|
||||
Destroy(PoseIK);
|
||||
}
|
||||
|
||||
PoseModeOn = false;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user