Ejemplo n.º 1
0
        private static void AddAnimation(AnimationBase animation)
        {
            if (counter % 50 == 0)
            {
                var toBeDeleted = new Collection <WeakReference>();
                foreach (var i in allAnimations)
                {
                    if (!i.IsAlive)
                    {
                        toBeDeleted.Add(i);
                    }
                }
                foreach (var i in toBeDeleted)
                {
                    allAnimations.Remove(i);
                }
            }

            counter++;
            allAnimations.Add(new WeakReference(animation));
        }
Ejemplo n.º 2
0
 protected AnimationBase()
 {
     AnimationBase.AddAnimation(this);
 }