예제 #1
0
    public static Texture2D GetIconTexture(ushort itemId)
    {
        Initialize();
        byte[] bytes = sp.GetPng(itemId, 0);
        if (bytes == null)
        {
            bytes = sp.GetPng(2, 0);
        }
        Texture2D toAssignImage = new Texture2D(2, 2);

        toAssignImage.LoadImage(bytes);

        return(toAssignImage);
    }
 public static Texture2D PullTextureFromParser(SpriteParser parser, string itemName)
 {
     byte[] items = parser.GetPng(itemName);
     if (items != null)
     {
         Texture2D toRet = new Texture2D(2, 2);
         toRet.LoadImage(items);
         return(toRet);
     }
     return(null);
 }