mirror of
https://github.com/hanetzer/sdraw_mods_cvr.git
synced 2025-09-05 11:29:23 +00:00
Mode switch handling, attempt two
This commit is contained in:
parent
66b448a2c3
commit
84b0de7065
13 changed files with 256 additions and 288 deletions
26
ml_lme/PoseHelper.cs
Normal file
26
ml_lme/PoseHelper.cs
Normal file
|
@ -0,0 +1,26 @@
|
|||
using UnityEngine;
|
||||
using ABI_RC.Systems.IK;
|
||||
|
||||
namespace ml_lme
|
||||
{
|
||||
static class PoseHelper
|
||||
{
|
||||
public static void ForceTPose(Animator p_animator)
|
||||
{
|
||||
if(p_animator.isHuman)
|
||||
{
|
||||
HumanPoseHandler l_handler = new HumanPoseHandler(p_animator.avatar, p_animator.transform);
|
||||
HumanPose l_pose = new HumanPose();
|
||||
l_handler.GetHumanPose(ref l_pose);
|
||||
|
||||
for(int i=0, j = Mathf.Min(l_pose.muscles.Length,MusclePoses.TPoseMuscles.Length); i < j; i++)
|
||||
l_pose.muscles[i] = MusclePoses.TPoseMuscles[i];
|
||||
|
||||
l_pose.bodyPosition = Vector3.up;
|
||||
l_pose.bodyRotation = Quaternion.identity;
|
||||
l_handler.SetHumanPose(ref l_pose);
|
||||
l_handler.Dispose();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue