private void UpdateMuscleIndices(int[] indices, PoseAnimator animator, bool isStart = false) { animator.UpdatePose(); var poseList = isStart ? StartPose: TargetPose; for (int m = 0; m < indices.Length; m++) { var muscleIndex = indices[m]; var value = animator.HumanPose.muscles[muscleIndex]; //animator.UpdateMuscle(muscleIndex, value); bool foundIndex = false; for (int s = 0; s < poseList.Count; s++) { if (poseList[s].MuscleIndex == muscleIndex) { poseList[s].Value = value; foundIndex = true; break; } } if (!foundIndex) { poseList.Add(new SavedMuscle(muscleIndex, value)); } } }
private void Setup(Playable playable) { _started = true; _duration = (float)playable.GetDuration(); Animator = PoseAnimator.Main; Animator.UpdatePose(); SetupPoseTransition(Animator.DefaultPose); }
public void SetPose(PoseAnimator animator) { animator.UpdatePose(); for (int i = 0; i < Pose.Count; i++) { animator.HumanPose.muscles[Pose[i].MuscleIndex] = Pose[i].Value; } animator.RefreshPose(); }
private void Setup(Playable playable) { _started = true; _duration = (float)playable.GetDuration(); _easeFunc = Easing.Function(EaseType); _startTime = TimeManager.Time; Animator = PoseAnimator.Main; Animator.UpdatePose(); for (int i = 0; i < Pose.Count; i++) { Pose[i].Start = Animator.HumanPose.muscles[Pose[i].MuscleIndex]; } }
private void UpdateMuscleIndices(int[] indices, PoseAnimator animator) { animator.UpdatePose(); for (int m = 0; m < indices.Length; m++) { var muscleIndex = indices[m]; var value = animator.HumanPose.muscles[muscleIndex]; //animator.UpdateMuscle(muscleIndex, value); var muscle = GetMuscle(muscleIndex); if (muscle == null) { muscle = new SavedMuscle(muscleIndex, value); Pose.Add(muscle); } else { muscle.Value = value; } } }
private void Setup(Playable playable) { _started = true; _duration = (float)playable.GetDuration(); Animator = PoseAnimator.Main; Animator.UpdatePose(); #if UNITY_EDITOR if (!Application.isPlaying) { return; } #endif if (!UpdateStart) { return; } for (int i = 0; i < Pose.Count; i++) { Pose[i].Start = Animator.HumanPose.muscles[Pose[i].MuscleIndex]; } }
private void UpdateMuscleIndices(int[] indices, PoseAnimator animator) { animator.UpdatePose(); for (int m = 0; m < indices.Length; m++) { var muscleIndex = indices[m]; var value = animator.HumanPose.muscles[muscleIndex]; //animator.UpdateMuscle(muscleIndex, value); bool foundIndex = false; for (int s = 0; s < Pose.Count; s++) { if (Pose[s].MuscleIndex == muscleIndex) { Pose[s].Value = value; foundIndex = true; break; } } if (!foundIndex) { Pose.Add(new SavedMuscle(muscleIndex, value)); } } }
public void SetPose(PoseAnimator animator) { _pivot.Restore(_isPrimary ? animator.PrimaryPivot : animator.SecondaryPivot); _handPose.SetPose(animator); }