Fixes to download script

This commit is contained in:
2025-07-16 21:11:37 -07:00
parent 2c80fbdf2d
commit 2b8e29b101
2 changed files with 9 additions and 0 deletions

View File

@@ -1,3 +1,6 @@
using System;
using System.Text;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using TMPro;
using UnityEngine;
@@ -16,6 +19,10 @@ public class IconMarketplaceDownloadIcon : MonoBehaviour
void Awake()
{
backButton.onClick.AddListener(() => marketplaceManager.SwitchPanel(0));
}
internal void Load()
{
GetIcons();
}
@@ -68,6 +75,7 @@ public class IconMarketplaceDownloadIcon : MonoBehaviour
{
JObject entry = (JObject)item;
GameObject newIcon = Instantiate(sample, content.transform);
newIcon.name = "Icon_" + Convert.ToBase64String(Encoding.UTF8.GetBytes(entry.ToString(Formatting.None)));
Tools.RenderFromBase64(entry["data"].ToString(), newIcon.transform.GetChild(0).GetChild(0).GetComponent<Image>());
newIcon.transform.GetChild(1).GetComponent<TMP_Text>().text = "Bird Name: " + entry["name"].ToString();