protected void runExitAnimation()
 {
     artToFade.color -= new Color(0, 0, 0, fullHereColor.a / amountToFadeBy) * Time.deltaTime;
     if (artToFade.color.a <= 0)
     {
         currentAnimationState = animationStates.EXITEND;
     }
 }
 protected void runEnterAnimation()
 {
     artToFade.color += new Color(0, 0, 0, fullHereColor.a / amountToFadeBy) * Time.deltaTime;
     if (artToFade.color.a >= fullHereColor.a)
     {
         currentAnimationState = animationStates.NONE;
     }
 }
        public void StartClip()
        {
            if (this.MyState == animationStates.STOPPED)
            {
                currentTimeValue = TimeSpan.Zero;
                currentKeyframe  = 0;
            }
            this.MyState = animationStates.PLAYING;

            // initialize bone transforms to the bind pose
            skinningDataValue.BindPose.CopyTo(boneTransforms, 0);
            Update(new TimeSpan(0), true, Matrix.Identity);
        }
        public AnimationPlayer(SkinningData skinningData, string animKey)
        {
            if (skinningData == null)
            {
                throw new ArgumentNullException("skinningData");
            }
            this.skinningDataValue = skinningData;
            this.AnimationKey      = animKey;
            this.MyState           = animationStates.STOPPED;
            boneTransforms         = new Matrix[skinningData.BindPose.Count];
            worldTransforms        = new Matrix[skinningData.BindPose.Count];
            skinTransforms         = new Matrix[skinningData.BindPose.Count];

            currentClipValue = null;
            if (!skinningData.AnimationClips.TryGetValue(animKey, out currentClipValue))
            {
                currentClipValue = new AnimationClip(new TimeSpan(1), new List <Keyframe>());
            }
            if (currentClipValue == null)
            {
                throw new ArgumentNullException("clip");
            }
        }
 public void PauseClip()
 {
     this.MyState = animationStates.PAUSED;
 }
 public void StopClip()
 {
     this.MyState = animationStates.STOPPED;
 }
 public void startExitAnimation()
 {
     currentAnimationState = animationStates.EXIT;
 }
 public void startEnterAnimation()
 {
     currentAnimationState = animationStates.ENTER;
 }
 protected void setDefaultFadeState()
 {
     fullHereColor         = artToFade.color; // used for our fade in and out;
     artToFade.color       = new Color(fullHereColor.r, fullHereColor.g, fullHereColor.b, emptyAlphaValue);
     currentAnimationState = animationStates.NONE;
 }
 protected void changeAnimationState(animationStates newAnimationState)
 {
     currentAnimationState = newAnimationState;
 }