Exemple #1
0
        /// <summary>
        /// Rearranges the index of an animation in the animation's current storing container
        /// </summary>
        /// <param name="anim">The animation to rearrange</param>
        /// <param name="newIndex">The new index to place the animation at</param>
        public void RearrangeAnimationsPosition(Animation anim, int newIndex)
        {
            AnimationSheet sheet = GetOwningAnimationSheet(anim);

            if (sheet == null)
            {
                _animations.Remove(anim);
                _animations.Insert(newIndex, anim);
            }
            else
            {
                sheet.RemoveAnimation(anim);
                sheet.InsertAnimation(anim, newIndex);
            }
        }
Exemple #2
0
        /// <summary>
        /// Removes the given animation sheet from this bundle.
        /// Removing an animation sheet decouples all animations from it automatically
        /// </summary>
        /// <param name="sheet">The animation sheet to remove</param>
        /// <param name="deleteAnimations">Whether to delete the nested animations as well. If set to false, the animations will be moved to the bundle's root</param>
        public void RemoveAnimationSheet(AnimationSheet sheet, bool deleteAnimations)
        {
            // Remove/relocate the animations
            foreach (Animation anim in sheet.Animations)
            {
                sheet.RemoveAnimation(anim);

                if (deleteAnimations)
                {
                    RemoveAnimation(anim);
                }
            }

            // Decouple all animatins from the sheet
            sheet.ClearAnimationList();

            _animationSheets.Remove(sheet);
        }
Exemple #3
0
 /// <summary>
 /// Removes the given Animation object from the given AnimationSheet object
 /// </summary>
 /// <param name="anim">The animation to remove from the animation sheet</param>
 /// <param name="sheet">The AnimationSheet to remove the animation from</param>
 public void RemoveAnimationFromAnimationSheet(Animation anim, AnimationSheet sheet)
 {
     sheet.RemoveAnimation(anim);
 }