public void LoadCustomAnimClips()
        {
            Debug.Log("LOADING THE ANIM CLIPS!!!!!");
            List <string> paths = PathMan.GetModFiles(PathMan.ANIM_CLIPS_PATH, ".png");

            Dictionary <string, AnimClipInfo> clipInfos = Utils.GetAnimClipInfos();
            AnimClipInfo defaultClipInto = new AnimClipInfo(); // if it is not defined in the XML

            // Pattern to be considered a frame: alphanumeric "ID" portion and the frame number, seperated with an underscore.
            Regex frameMatchRegex = new Regex(@"(\w+)_([0-9]+)", RegexOptions.IgnoreCase);

            // The key is the id of the anim clip, the value is the list of frames for that clip.
            Dictionary <string, List <AnimClipFrame> > animClips = new Dictionary <string, List <AnimClipFrame> >();

            foreach (string path in paths)
            {
                Match result = frameMatchRegex.Match(path);
                if (result.Success)
                {
                    AnimClipFrame newAnimClipFrame = new AnimClipFrame(path, result.Groups[1].Value, int.Parse(result.Groups[2].Value));
                    // Make a new list for the anim clip key if it doesn't exist already
                    if (!animClips.ContainsKey(newAnimClipFrame.key))
                    {
                        animClips[newAnimClipFrame.key] = new List <AnimClipFrame>();
                    }
                    animClips[newAnimClipFrame.key].Add(newAnimClipFrame);
                }
            }

            foreach (string key in animClips.Keys)
            {
                Debug.Log(String.Format("Getting files for anim clip {0} ", key));
                List <AnimClipFrame> currentFrames = animClips[key];
                // sorting is required since the files could be like
                // Sprite_9.png, Sprite_10.png (the 10 would be first in lexographic sort!)
                currentFrames.Sort();

                // Make an anim clip now.
                List <string> fullPaths = new List <string>();
                foreach (AnimClipFrame clip in currentFrames)
                {
                    fullPaths.Add(clip.fullPath);
                }
                AnimClipInfo newInfo;
                if (!clipInfos.ContainsKey(key))
                {
                    newInfo = defaultClipInto;
                }
                else
                {
                    newInfo = clipInfos[key];
                }
                SpriteAnimationClip newClip = Utils.LoadNewSpriteAnimationClip(fullPaths.ToArray(), newInfo);
                this.spriteAnimClips[key] = newClip;
                Debug.Log("Done with this anim clip!");
            }
        }
        int IComparable.CompareTo(object obj)
        {
            AnimClipFrame other = (AnimClipFrame)obj;

            return(number.CompareTo(other.number));
        }