private void ClearPartialAnimation(PartialAnimation ActivePartialAnimation)
        {
            for (int L = 0; L < ActivePartialAnimation.ListAnimationLayer.Count; L++)
            {
                foreach (VisibleTimeline ActiveBitmap in ActivePartialAnimation.ListAnimationLayer[L].ListVisibleObject)
                {
                    ActiveBitmap.OnDeathFrame(this);
                }
                foreach (MarkerTimeline ActiveMarker in ActivePartialAnimation.ListAnimationLayer[L].ListActiveMarker)
                {
                    ActiveMarker.OnDeathFrame(this);
                }
                foreach (PolygonCutterTimeline ActivePolygonCutter in ActivePartialAnimation.ListAnimationLayer[L].ListPolygonCutter)
                {
                    ActivePolygonCutter.OnDeathFrame(this);
                }
                ActivePartialAnimation.ListAnimationLayer[L].ResetAnimationLayer();
            }

            ActivePartialAnimation.ActiveKeyFrame = ActivePartialAnimation.LoopStart;

            for (int F = 0; F < ActivePartialAnimation.ActiveKeyFrame; F++)
            {
                ActivePartialAnimation.UpdateKeyFrame(F);
            }
        }
        protected virtual void OnLoopEnd()
        {
            CurrentQuote = "";
            ListActiveSFX.Clear();
            DicActiveAnimationObject.Clear();

            for (int L = 0; L < ListAnimationLayer.Count; L++)
            {
                foreach (VisibleTimeline ActiveBitmap in ListAnimationLayer[L].ListVisibleObject)
                {
                    ActiveBitmap.OnDeathFrame(this);
                }
                foreach (MarkerTimeline ActiveMarker in ListAnimationLayer[L].ListActiveMarker)
                {
                    ActiveMarker.OnDeathFrame(this);
                }
                foreach (PolygonCutterTimeline ActivePolygonCutter in ListAnimationLayer[L].ListPolygonCutter)
                {
                    ActivePolygonCutter.OnDeathFrame(this);
                }

                ListAnimationLayer[L].ResetAnimationLayer();
            }

            ActiveKeyFrame = LoopStart;

            for (int F = 0; F <= ActiveKeyFrame; F++)
            {
                UpdateKeyFrame(F);
            }
        }
        public AnimationClass SetAnimation(string NewAnimation)
        {
            if (CurrentAnimation == NewAnimation)
            {
                return(DicAnimation[NewAnimation]);
            }

            DicActiveAnimationObject.Clear();

            AnimationClass NewAnimationClass;

            DicAnimation.TryGetValue(NewAnimation, out NewAnimationClass);

            if (NewAnimationClass == null)
            {
                NewAnimationClass = CreateAnimation(NewAnimation, false);
                DicAnimation.Add(NewAnimation, NewAnimationClass);
            }

            CurrentAnimation = NewAnimation;

            if (ListAnimationLayer != null)
            {
                for (int L = 0; L < ListAnimationLayer.Count; L++)
                {
                    foreach (VisibleTimeline ActiveBitmap in ListAnimationLayer[L].ListVisibleObject)
                    {
                        ActiveBitmap.OnDeathFrame(this);
                    }
                    foreach (MarkerTimeline ActiveMarker in ListAnimationLayer[L].ListActiveMarker)
                    {
                        ActiveMarker.OnDeathFrame(this);
                    }
                    foreach (PolygonCutterTimeline ActivePolygonCutter in ListAnimationLayer[L].ListPolygonCutter)
                    {
                        ActivePolygonCutter.OnDeathFrame(this);
                    }
                }
            }

            ListAnimationLayer = DicAnimation[CurrentAnimation].ListAnimationLayer;
            ActiveKeyFrame     = 0;

            LoopStart = DicAnimation[CurrentAnimation].LoopStart;
            LoopEnd   = DicAnimation[CurrentAnimation].LoopEnd;

            for (int L = 0; L < ListAnimationLayer.Count; L++)
            {
                ListAnimationLayer[L].ResetAnimationLayer();
            }

            Init();

            return(NewAnimationClass);
        }