Exemple #1
0
        private void LoadSprites(string animationName)
        {
            if (spriteAtlas == null)
            {
                return;
            }

            var referenceName = string.Format("SpriteAnimation.{0}", spriteAtlas.GetInstanceID());

            spriteCache = new SpriteAtlasCache(spriteAtlas, referenceName);

            animationCount = 0;

            while (true)
            {
                var spriteName = GetSpriteName(animationCount);

                var sprite = spriteCache.GetSprite(spriteName);

                if (sprite == null)
                {
                    break;
                }

                animationCount++;
            }
        }
Exemple #2
0
        //----- method -----

        public AtlasCache(string atlasPath, SpriteAtlas atlas)
        {
            AtlasPath = atlasPath;
            Atlas     = atlas;

            spriteCache = new SpriteAtlasCache(atlas);
        }