当前位置: 首页>>代码示例>>C#>>正文


C# UMAData.ApplyDNA方法代码示例

本文整理汇总了C#中UMAData.ApplyDNA方法的典型用法代码示例。如果您正苦于以下问题:C# UMAData.ApplyDNA方法的具体用法?C# UMAData.ApplyDNA怎么用?C# UMAData.ApplyDNA使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在UMAData的用法示例。


在下文中一共展示了UMAData.ApplyDNA方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: UpdateUMABody

	    public virtual void UpdateUMABody (UMAData umaData){
			if(umaData)
	        {
                umaData.GotoOriginalPose();
                umaData.skeleton = new UMASkeletonDefault(umaData.myRenderer.rootBone);
                umaData.ApplyDNA();
                UpdateAvatar(umaData);
			}
		}
开发者ID:CStudios15,项目名称:UMA,代码行数:9,代码来源:UMAGenerator.cs

示例2: UpdateUMABody

 public virtual void UpdateUMABody(UMAData umaData)
 {
     if (umaData)
     {
         umaData.skeleton.ResetAll();
         umaData.ApplyDNA();
         umaData.FireDNAAppliedEvents();
         UpdateAvatar(umaData);
     }
 }
开发者ID:petesimard,项目名称:UMA,代码行数:10,代码来源:UMAGeneratorBuiltin.cs

示例3: UpdateUMABody

 public virtual void UpdateUMABody(UMAData umaData)
 {
     if(umaData)
     {
         umaData.GotoOriginalPose();
         umaData.skeleton = new UMASkeletonDefault(umaData.boneHashList);
         umaData.ApplyDNA();
         UpdateAvatar(umaData);
     }
 }
开发者ID:jlu3389,项目名称:UMA,代码行数:10,代码来源:UMAGenerator.cs

示例4: UpdateUMABody

		public virtual void UpdateUMABody(UMAData umaData)
		{
			umaData.ApplyDNA();
		}
开发者ID:fgeraci,项目名称:CS195-Core,代码行数:4,代码来源:UMAEditorGenerator.cs

示例5: UpdateUMABody

        public virtual void UpdateUMABody(UMAData umaData)
        {
            if(umaData)
            {
                AnimationState[] snapshot = null;
                if (umaData.animationController)
                {
                    if(unityVersion >= 4.3f){
                        var animator = umaData.GetComponent<Animator>();
                        if (animator != null)
                        {

                            snapshot = new AnimationState[animator.layerCount];
                            for (int i = 0; i < animator.layerCount; i++)
                            {
                                var state = animator.GetCurrentAnimatorStateInfo(i);
                                snapshot[i].stateHash = state.nameHash;
                                snapshot[i].stateTime = Mathf.Max(0, state.normalizedTime - Time.deltaTime / state.length);
                            }
                        }
                    }
                    foreach (var entry in umaData.boneList)
                    {
                        entry.Value.boneTransform.localPosition = entry.Value.originalBonePosition;
                        entry.Value.boneTransform.localScale = entry.Value.originalBoneScale;
                        entry.Value.boneTransform.localRotation = entry.Value.originalBoneRotation;
                    }
                }
                umaData.ApplyDNA();
                if (umaData.animationController)
                {
                    var animator = umaData.GetComponent<Animator>();

                    bool applyRootMotion = false;
                    bool animatePhysics = false;
                    AnimatorCullingMode cullingMode = AnimatorCullingMode.AlwaysAnimate;

                    if(animator){
                        applyRootMotion = animator.applyRootMotion;
                        animatePhysics = animator.animatePhysics;
                        cullingMode = animator.cullingMode;
                        Object.DestroyImmediate(animator);
                    }
                    var oldParent = umaData.transform.parent;
                    umaData.transform.parent = null;
                    CreateAnimator(umaData.gameObject, umaData.umaRecipe.raceData.TPose, umaData.animationController,applyRootMotion,animatePhysics,cullingMode);
                    umaData.transform.parent = oldParent;
                    animator = umaData.GetComponent<Animator>();
                    if(unityVersion >= 4.3f){
                        if (snapshot != null)
                        {
                            for (int i = 0; i < animator.layerCount; i++)
                            {
                                animator.Play(snapshot[i].stateHash, i, snapshot[i].stateTime);
                            }
                            animator.Update(0);
                        }
                    }
                }
            }
        }
开发者ID:stoddy2hotty,项目名称:UMA,代码行数:61,代码来源:UMAGenerator.cs


注:本文中的UMAData.ApplyDNA方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。