public float UpperArmFixWeight = 0.2f; //0.5では強すぎて肩がねじれる場合がある public void SetVRIK(VRIK setIK) { if (ik != null) { ik.GetIKSolver().OnPostUpdate -= OnPostUpdate; } ik = setIK; LeftElbowFixItem = new FixItem(ik.references.leftUpperArm, ik.references.leftForearm, ik.references.leftHand, () => ElbowFixWeight); LeftUpperArmFixItem = new FixItem(ik.references.leftShoulder, ik.references.leftUpperArm, ik.references.leftForearm, () => UpperArmFixWeight); RightElbowFixItem = new FixItem(ik.references.rightUpperArm, ik.references.rightForearm, ik.references.rightHand, () => ElbowFixWeight); RightUpperArmFixItem = new FixItem(ik.references.rightShoulder, ik.references.rightUpperArm, ik.references.rightForearm, () => UpperArmFixWeight); if (ik != null) { ik.GetIKSolver().OnPostUpdate += OnPostUpdate; } }
// Start is called before the first frame update void Start() { animator = GetComponent <Animator>(); solverVR = (IKSolverVR)vrik.GetIKSolver(); }