示例#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++;
            }
        }
示例#2
0
        private void UpdateAnimation(int index)
        {
            var spriteName = GetSpriteName(index);

            var sprite = spriteCache.GetSprite(spriteName);

            if (sprite != null)
            {
                if (onUpdateAnimation != null)
                {
                    onUpdateAnimation.OnNext(sprite);
                }
            }
        }
示例#3
0
 public Sprite GetSprite(string spriteName)
 {
     return(spriteCache.GetSprite(spriteName));
 }