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; }
/// <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); }
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; }
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; }
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; }
/// <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); }
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; }
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); }
/// <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; }
void OnEnable() { source = target as UmaTPose; source.DeSerialize(); }