Exemplo n.º 1
0
        /**
         * Qualifies all resources used by this Animation instance for garbage collection.
         */
        public void Dispose()
        {
            if (_armature == null)
            {
                return;
            }
            Stop();
            int i = _animationLayer.Count;

            while (i-- > 0)
            {
                List <AnimationState> animationStateList = _animationLayer[i];
                int j = animationStateList.Count;
                while (j-- > 0)
                {
                    AnimationState.returnObject(animationStateList[j]);
                }
                animationStateList.Clear();
            }
            _animationLayer.Clear();
            _animationList.Clear();

            _armature          = null;
            _animationLayer    = null;
            _animationDataList = null;
            _animationList     = null;
        }
Exemplo n.º 2
0
        private void removeState(AnimationState animationState)
        {
            int layer = (int)animationState.Layer;
            List <AnimationState> animationStateList = _animationLayer[layer];

            animationStateList.RemoveAt(animationStateList.IndexOf(animationState));

            AnimationState.returnObject(animationState);

            if (animationStateList.Count == 0 && layer == _animationLayer.Count - 1)
            {
                _animationLayer.RemoveAt(_animationLayer.Count - 1);
            }
        }