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++; } }
private void UpdateAnimation(int index) { var spriteName = GetSpriteName(index); var sprite = spriteCache.GetSprite(spriteName); if (sprite != null) { if (onUpdateAnimation != null) { onUpdateAnimation.OnNext(sprite); } } }
public Sprite GetSprite(string spriteName) { return(spriteCache.GetSprite(spriteName)); }