GetImage()

Found in:

public Sprite GetImage(string img, string type = "background"){
      if(type == "background"){
        foreach (Sprite background in backgrounds){
          if(background.name == "inventory-card-bg-"+img){
            return background;
          }
        }
      }else if(type == "inventory"){
        foreach (Sprite itemBackground in itemBackgrounds){
          if(itemBackground.name == "inventory-popup-card-bg-"+img){
            return itemBackground;
          }
        }
      }else if(type == "inventorybg"){
        foreach (Sprite inventoryItemBackground in inventoryItemBackgrounds){
          if(inventoryItemBackground.name == "inventory-popup-small-element-"+img){
            return inventoryItemBackground;
          }
        }
      }else{
        foreach (Sprite element in elements){
          if(element.name == "inventory-card-element-"+img){
            return element;
          }
        }
      }

      return null;
    }


Comments

Leave a Reply

Your email address will not be published. Required fields are marked *