using TMPro; using UnityEngine; using UnityEngine.SceneManagement; using UnityEngine.UI; public class Iconsmenu : MonoBehaviour { public GameObject iconsPanel; public GameObject overlaysPanel; public Button backButton; public Sprite defaultIcon; public Button placeholderButton; public TMP_Text selectionText; public Image previewBird; public Image previewOverlay; public Button icon1; public Button icon2; public Button icon3; public Button icon4; public Button icon5; public Button icon6; public Button icon7; public Button icon8; public Button overlay0; public Button overlay1; public Button overlay2; public Button overlay3; public Button overlay4; public Button overlay5; public Button overlay6; public Button overlay7; public Button overlay8; public Button overlay9; public Button overlay10; public Button overlay11; public Button overlay12; public Button overlay13; public Button overlay14; public GameObject previewBirdObject; private void Start() { defaultIcon = Tools.GetIconForUser(PlayerPrefs.GetInt("userId", 0)); icon1.transform.GetChild(0).GetComponent().sprite = defaultIcon; SwitchToIcon(); SelectOverlay(PlayerPrefs.GetInt("overlay", Mathf.Clamp(PlayerPrefs.GetInt("overlay", 0), 0, 14))); SelectIcon(PlayerPrefs.GetInt("icon", Mathf.Clamp(PlayerPrefs.GetInt("icon", 0), 1, 8))); if (PlayerPrefs.GetInt("icon", 0) == 7) { SelectOverlay(0); placeholderButton.interactable = false; } placeholderButton.onClick.AddListener(ToggleKit); backButton.onClick.AddListener(async () => { PlayerPrefs.SetInt("icon", Mathf.Clamp(PlayerPrefs.GetInt("icon", 0), 1, 8)); PlayerPrefs.SetInt("overlay", Mathf.Clamp(PlayerPrefs.GetInt("overlay", 0), 0, 14)); PlayerPrefs.Save(); await SceneManager.LoadSceneAsync("MainMenu"); }); previewBird.GetComponentInParent