Пример #1
0
    public void SetData(ItemTheme data)
    {
        _data = data as ItemTheme;
        string url = "Theme/Theme_" + data.nameTheme;

        img.sprite     = Resources.Load <Sprite>(url);
        nameTheme.text = data.nameTheme;
    }
Пример #2
0
 void onCallClicked(ItemTheme data)
 {
     GameManager.Instance.themeCurent = data;
     SceneManager.LoadScene(Constants.THEME_SCENE);
 }
Пример #3
0
 public Sprite[] getListImgeByTheme(ItemTheme typeTheme)
 {
     if (typeTheme.type == TypeTheme.Classic)
     {
         if (spritesClassic == null)
         {
             string path = "Icon/Classic";
             spritesClassic = Resources.LoadAll <Sprite>(path);
         }
         return(spritesClassic);
     }
     else if (typeTheme.type == TypeTheme.Fashion)
     {
         if (spritesFashion == null)
         {
             string path = "Icon/Fashion";
             spritesFashion = Resources.LoadAll <Sprite>(path);
         }
         return(spritesFashion);
     }
     else if (typeTheme.type == TypeTheme.FreeStyle)
     {
         if (spritesFreeStyle == null)
         {
             string path = "Icon/FreeStyle";
             spritesFreeStyle = Resources.LoadAll <Sprite>(path);
         }
         return(spritesFreeStyle);
     }
     else if (typeTheme.type == TypeTheme.Ghost)
     {
         if (spritesGhost == null)
         {
             string path = "Icon/Ghosts";
             spritesGhost = Resources.LoadAll <Sprite>(path);
         }
         return(spritesGhost);
     }
     else if (typeTheme.type == TypeTheme.Halloween)
     {
         if (spritesHalloween == null)
         {
             string path = "Icon/Halloween";
             spritesHalloween = Resources.LoadAll <Sprite>(path);
         }
         return(spritesHalloween);
     }
     else if (typeTheme.type == TypeTheme.Kute)
     {
         if (spritesKute == null)
         {
             string path = "Icon/Kute";
             spritesKute = Resources.LoadAll <Sprite>(path);
         }
         return(spritesKute);
     }
     else if (typeTheme.type == TypeTheme.Lol)
     {
         if (spritesLol == null)
         {
             string path = "Icon/LOL";
             spritesLol = Resources.LoadAll <Sprite>(path);
         }
         return(spritesLol);
     }
     else if (typeTheme.type == TypeTheme.Noel)
     {
         if (spritesNoel == null)
         {
             string path = "Icon/Noel";
             spritesNoel = Resources.LoadAll <Sprite>(path);
         }
         return(spritesNoel);
     }
     else
     {
         return(null);
     }
 }