Пример #1
0
 public IEnumerator <IYieldInstruction> PlayComplexAnimation(ComplexUvAnimation cAnimation)
 {
     mIsPlaying = true;
     foreach (ComplexFrame cFrame in cAnimation.Frames)
     {
         /* Repeat this frame RepeatFrame times */
         for (int x = 0; x < cFrame.RepeatFrame; ++x)
         {
             /* wait till FaceMesh is idle */
             while (mAvatarFaceMesh.IsPlaying)
             {
                 yield return(new YieldUntilNextFrame());
             }
             /* Start all simpleAnimations in this Complexframe */
             foreach (SimpleUvAnimation uvAnimation in cFrame.UvAnimations)
             {
                 PlayUvAnimation(uvAnimation);
             }
             /* wait for a frame before looping. Otherwise FaceMesh may not have been updated to idle yet */
             yield return(new YieldUntilNextFrame());
         }
         // When we are done playing a frame, wait for WaitAfterFinished seconds
         yield return(new YieldForSeconds(cFrame.WaitAfterFinished));
     }
     mIsPlaying = false;
 }
Пример #2
0
 private void SetupComplexUvAnimations(XmlNode rootNode)
 {
     /* foreach ComplexUvAnimation Range */
     foreach (XmlNode complexUvAnimationNode in rootNode.SelectNodes("ComplexUvAnimations/Animation"))
     {
         ComplexUvAnimation newCuva = ParseComplexUvAnimation(complexUvAnimationNode);
         if (newCuva == null)
         {
             Console.LogError("Complex Uv Animation could not be created from node: " + complexUvAnimationNode);
         }
         else
         {
             string complexUvAnimationId = XmlUtility.GetStringAttribute(complexUvAnimationNode, "assetId");
             mUvAnimationLookUpTable.Add(complexUvAnimationId, newCuva);
         }
     }
 }
Пример #3
0
 private void PlayAnimation(UvAnimation animation)
 {
     if (animation is SimpleUvAnimation)
     {
         mComplexUvAnimator.StopAnimation();
         SimpleUvAnimation simpleUvAnimation = (SimpleUvAnimation)animation;
         mComplexUvAnimator.PlayUvAnimation(simpleUvAnimation);
     }
     else if (animation is ComplexUvAnimation)
     {
         mComplexUvAnimator.StopAnimation();
         ComplexUvAnimation complexUvAnimation = (ComplexUvAnimation)animation;
         mScheduler.StartCoroutine(mComplexUvAnimator.PlayComplexAnimation(complexUvAnimation));
     }
     else
     {
         Console.LogError("UvAnimation being passed into PlayAnimation is neither a SimpleUvAnimation or ComplexUvAnimation type");
     }
 }
Пример #4
0
 public ComplexUvAnimationAsset(AssetSubType type, ComplexUvAnimation animation, string displayName, string path, string key)
     : base(type, displayName, path, key)
 {
     mAnimation = animation;
 }