本文整理汇总了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);
}
}
示例2: UpdateUMABody
public virtual void UpdateUMABody(UMAData umaData)
{
if (umaData)
{
umaData.skeleton.ResetAll();
umaData.ApplyDNA();
umaData.FireDNAAppliedEvents();
UpdateAvatar(umaData);
}
}
示例3: UpdateUMABody
public virtual void UpdateUMABody(UMAData umaData)
{
if(umaData)
{
umaData.GotoOriginalPose();
umaData.skeleton = new UMASkeletonDefault(umaData.boneHashList);
umaData.ApplyDNA();
UpdateAvatar(umaData);
}
}
示例4: UpdateUMABody
public virtual void UpdateUMABody(UMAData umaData)
{
umaData.ApplyDNA();
}
示例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);
}
}
}
}
}