예제 #1
0
 public static Avatar CreateAvatar(UMAData umaData, UmaTPose umaTPose)
 {
     umaTPose.DeSerialize();
     HumanDescription description = CreateHumanDescription(umaData, umaTPose);
     //DebugLogHumanAvatar(umaData.umaRoot, description);
     Avatar res = AvatarBuilder.BuildHumanAvatar(umaData.umaRoot, description);
     return res;
 }
예제 #2
0
        /// <summary>
        /// Creates a human (biped) avatar for a UMA character.
        /// </summary>
        /// <returns>The human avatar.</returns>
        /// <param name="umaData">UMA data.</param>
        /// <param name="umaTPose">UMA TPose.</param>
        public static Avatar CreateAvatar(UMAData umaData, UmaTPose umaTPose)
        {
            umaTPose.DeSerialize();
            HumanDescription description = CreateHumanDescription(umaData, umaTPose);
            //DebugLogHumanAvatar(umaData.gameObject, description);
            Avatar res = AvatarBuilder.BuildHumanAvatar(umaData.gameObject, description);

            return(res);
        }
예제 #3
0
 public static void CreateAnimator(GameObject root, UmaTPose umaTPose, RuntimeAnimatorController controller,bool applyRootMotion, bool animatePhysics,AnimatorCullingMode cullingMode)
 {
     umaTPose.DeSerialize();
     var animator = root.AddComponent<Animator>();
     animator.avatar = CreateAvatar(root, umaTPose);
     animator.runtimeAnimatorController = controller;
     animator.applyRootMotion = applyRootMotion;
     animator.animatePhysics = animatePhysics;
     animator.cullingMode = cullingMode;
 }
예제 #4
0
 public static Animator CreateAnimator(UMAData umaData, UmaTPose umaTPose, RuntimeAnimatorController controller, bool applyRootMotion, bool animatePhysics, AnimatorCullingMode cullingMode)
 {
     umaTPose.DeSerialize();
     var animator = umaData.umaRoot.AddComponent<Animator>();
     animator.avatar = CreateAvatar(umaData, umaTPose);
     animator.runtimeAnimatorController = controller;
     animator.applyRootMotion = applyRootMotion;
     animator.animatePhysics = animatePhysics;
     animator.cullingMode = cullingMode;
     return animator;
 }
예제 #5
0
    public static void CreateAnimator(GameObject root, UMA.UmaTPose umaTPose, RuntimeAnimatorController controller)
    {
        umaTPose.DeSerialize();
        var animator = root.AddComponent <Animator>();

        animator.avatar = CreateAvatar(root, umaTPose);
        animator.runtimeAnimatorController = controller;
        animator.applyRootMotion           = true;
        //   animator.animatePhysics = false;
        //	AnimationMode.
        animator.cullingMode = AnimatorCullingMode.AlwaysAnimate;
    }
예제 #6
0
        /// <summary>
        /// Creates a new animator for a UMA character.
        /// </summary>
        /// <returns>The animator.</returns>
        /// <param name="umaData">UMA data.</param>
        /// <param name="umaTPose">UMA TPose.</param>
        /// <param name="controller">Animation controller.</param>
        public static Animator CreateAnimator(UMAData umaData, UmaTPose umaTPose, RuntimeAnimatorController controller)
        {
            var animator = umaData.gameObject.AddComponent <Animator>();

            switch (umaData.umaRecipe.raceData.umaTarget)
            {
            case RaceData.UMATarget.Humanoid:
                umaTPose.DeSerialize();
                animator.avatar = CreateAvatar(umaData, umaTPose);
                break;

            case RaceData.UMATarget.Generic:
                animator.avatar = CreateGenericAvatar(umaData);
                break;
            }
            animator.runtimeAnimatorController = controller;
            return(animator);
        }
예제 #7
0
 public static Animator CreateAnimator(UMAData umaData, UmaTPose umaTPose, RuntimeAnimatorController controller, bool applyRootMotion, bool animatePhysics, AnimatorCullingMode cullingMode)
 {
     var animator = umaData.umaRoot.AddComponent<Animator>();
     switch (umaData.umaRecipe.raceData.umaTarget)
     {
         case RaceData.UMATarget.Humanoid:
             umaTPose.DeSerialize();
             animator.avatar = CreateAvatar(umaData, umaTPose);
             break;
         case RaceData.UMATarget.Generic:
             animator.avatar = CreateGenericAvatar(umaData);
             break;
     }
     animator.runtimeAnimatorController = controller;
     animator.applyRootMotion = applyRootMotion;
     animator.animatePhysics = animatePhysics;
     animator.cullingMode = cullingMode;
     return animator;
 }
예제 #8
0
        public static Animator CreateAnimator(UMAData umaData, UmaTPose umaTPose, RuntimeAnimatorController controller, bool applyRootMotion, bool animatePhysics, AnimatorCullingMode cullingMode)
        {
            var animator = umaData.umaRoot.AddComponent <Animator>();

            switch (umaData.umaRecipe.raceData.umaTarget)
            {
            case RaceData.UMATarget.Humanoid:
                umaTPose.DeSerialize();
                animator.avatar = CreateAvatar(umaData, umaTPose);
                break;

            case RaceData.UMATarget.Generic:
                animator.avatar = CreateGenericAvatar(umaData);
                break;
            }
            animator.runtimeAnimatorController = controller;
            animator.applyRootMotion           = applyRootMotion;
            animator.animatePhysics            = animatePhysics;
            animator.cullingMode = cullingMode;
            return(animator);
        }
예제 #9
0
		/// <summary>
		/// Creates a new animator for a UMA character.
		/// </summary>
		/// <returns>The animator.</returns>
		/// <param name="umaData">UMA data.</param>
		/// <param name="umaTPose">UMA TPose.</param>
		/// <param name="controller">Animation controller.</param>
		public static Animator CreateAnimator(UMAData umaData, UmaTPose umaTPose, RuntimeAnimatorController controller)
		{
			var animator = umaData.gameObject.AddComponent<Animator>();
			switch (umaData.umaRecipe.raceData.umaTarget)
			{
				case RaceData.UMATarget.Humanoid:
					umaTPose.DeSerialize();
					animator.avatar = CreateAvatar(umaData, umaTPose);
					break;
				case RaceData.UMATarget.Generic:
					animator.avatar = CreateGenericAvatar(umaData);
					break;
			}
			animator.runtimeAnimatorController = controller;
			return animator;
		}
예제 #10
0
 void OnEnable()
 {
     source = target as UmaTPose;
     source.DeSerialize();
 }