Esempio n. 1
0
 public void ChangeClip(int newClip, bool loop, float speed = 1f, float blendSpeed = 1f)
 {
     if (newClip != -1)
     {
         model.PlayClip(model.Clips[newClip], loop, speed, blendSpeed);
     }
     else
     {
         if (blendSpeed >= 1)
         {
             IdentityPose();
         }
         else
         {
             model.PlayClip(model.Clips[0], loop, 0, blendSpeed, 0);
         }
     }
 }
Esempio n. 2
0
        public AnimatedModel model;//, animation;

        public R_Animation(string assetName, int animationClip, RenderMethod renderMethod = RenderMethod.Deferred)
        {
            model = new AnimatedModel(assetName);
            model.LoadContent(renderMethod);
            if (animationClip >= model.Clips.Count)
            {
                animationClip = -1;
            }

            if (animationClip == -1)
            {
                IdentityPose();
            }
            else if (animationClip >= 0 && animationClip < model.Clips.Count)
            {
                AnimationClip   clip   = model.Clips[animationClip];
                AnimationPlayer player = model.PlayClip(clip, true);
            }
        }