Sfoglia il codice sorgente

Changes from Downloader.

Stephen Damm 5 anni fa
parent
commit
1a5667f4cf
1 ha cambiato i file con 2 aggiunte e 1 eliminazioni
  1. 2 1
      SongBrowserPlugin/DataAccess/LoadScripts.cs

+ 2 - 1
SongBrowserPlugin/DataAccess/LoadScripts.cs

@@ -27,7 +27,8 @@ namespace SongBrowser.DataAccess
                 yield return www;
                 yield return www;
                 tex = www.texture;
                 tex = www.texture;
                 var newSprite = Sprite.Create(tex, new Rect(0, 0, tex.width, tex.height), Vector2.one * 0.5f, 100, 1);
                 var newSprite = Sprite.Create(tex, new Rect(0, 0, tex.width, tex.height), Vector2.one * 0.5f, 100, 1);
-                _cachedSprites.Add(spritePath, newSprite);
+                if (!_cachedSprites.ContainsKey(spritePath))
+                    _cachedSprites.Add(spritePath, newSprite);
                 finished.Invoke(newSprite);
                 finished.Invoke(newSprite);
             }
             }
         }
         }