Exemple #1
0
 public Sprite GetSprite(PokemonSprite.Type type)
 {
     for (int i = 0; i < pokemonSprites.Count; i++)
     {
         if (pokemonSprites[i].type == type)
         {
             return(pokemonSprites[i].sprite);
         }
     }
     return(pokemonSprites[0].sprite);
 }
Exemple #2
0
    IEnumerator GetSprite(string url, int index, PokemonSprite.Type type)
    {
        WWW request = new WWW(url);

        yield return(request);

        Texture2D texture = request.texture;

        Sprite sprite = Sprite.Create(texture, new Rect(0, 0, texture.width, texture.height), Vector2.zero, texture.width * 0.3f);

        pokemonArray[index].sprites.pokemonSprites.Add(new PokemonSprite(sprite, type));
    }