예제 #1
0
    void OnAnimatorIK()
    {
        if (!ac.CheckState("death"))
        {
            if (anim.GetBool("Defense") == false)
            {
                anim.SetBoneLocalRotation(HumanBodyBones.LeftUpperArm,
                                          Quaternion.Euler(LeftArm.localEulerAngles += LeftUpperArmEular));
                Transform LeftLowerArm = anim.GetBoneTransform(HumanBodyBones.LeftLowerArm);
                LeftLowerArm.localEulerAngles += LeftLowerArmEular;
                anim.SetBoneLocalRotation(HumanBodyBones.LeftLowerArm, Quaternion.Euler(LeftLowerArm.localEulerAngles));
            }

            else if (anim.GetBool("Defense") == true)
            {
                anim.SetBoneLocalRotation(HumanBodyBones.LeftUpperArm,
                                          Quaternion.Euler(LeftArm.localEulerAngles += LeftUpperArmEular));
            }
        }
    }