예제 #1
0
파일: UMABonePose.cs 프로젝트: hafewa/UMA-1
        public void ApplyPose(UMASkeleton umaSkeleton, float weight)
        {
            if ((poses == null) || (umaSkeleton == null))
            {
                Debug.LogError("Missing poses or skeleton!");
                return;
            }

            if ((tweenPoses != null) && (tweenPoses.Length > 0) && (weight < 1f))
            {
                weight = ApplyPoseTweens(umaSkeleton, weight);
            }

            if (weight <= 0f)
            {
                return;
            }

            foreach (PoseBone pose in poses)
            {
                umaSkeleton.Lerp(pose.hash, pose.position, pose.scale, pose.rotation, weight);
            }
        }
예제 #2
0
		/// <summary>
		/// Applies the pose to the given skeleton.
		/// </summary>
		/// <remarks>
		/// LERP the pose onto a skeleton at the given strength.
		/// Weight is normally in the 0-1 range but is not clamped.
		/// </remarks>
		/// <param name="umaSkeleton">Skeleton.</param>
		/// <param name="weight">Weight.</param>
		public void ApplyPose(UMASkeleton umaSkeleton, float weight)
		{
			if ((poses == null) || (umaSkeleton == null))
			{
				Debug.LogError("Missing poses or skeleton!");
				return;
			}

			if ((tweenPoses != null) && (tweenPoses.Length > 0) && (weight < 1f))
			{
				weight = ApplyPoseTweens(umaSkeleton, weight);
			}

			if (weight <= 0f)
			{
				return;
			}

			foreach (PoseBone pose in poses)
			{
				umaSkeleton.Lerp(pose.hash, pose.position, pose.scale, pose.rotation, weight);
			}
		}