Make icon kit into a popup
This commit is contained in:
6 files changed
+11290
-11851
No files matched your search
@@ -16,6 +16,7 @@ public class MainMenu : MonoBehaviour {
|
||||
[SerializeField] private SettingsMenu settingsPrefab;
|
||||
[SerializeField] private StatsPrefab statsPrefab;
|
||||
[SerializeField] private PlayModePrefab playModePrefab;
|
||||
[SerializeField] private IconkitPrefab iconkitPrefab;
|
||||
[SerializeField] private TMP_Text copyrightText;
|
||||
[SerializeField] private GameObject closePopup;
|
||||
[SerializeField] private Button closePopupCancelButton;
|
||||
@@ -26,6 +27,7 @@ public class MainMenu : MonoBehaviour {
|
||||
[SerializeField] private Button settingsButton;
|
||||
[SerializeField] private Button statsButton;
|
||||
[SerializeField] private Button playButton;
|
||||
[SerializeField] private Button iconkitButton;
|
||||
|
||||
void Awake() {
|
||||
if (PresistentData.latestVersion != null) {
|
||||
@@ -89,6 +91,11 @@ public class MainMenu : MonoBehaviour {
|
||||
clone.name = "Prefab";
|
||||
clone.SetActive(true);
|
||||
});
|
||||
iconkitButton.onClick.AddListener(() => {
|
||||
var clone = Instantiate(iconkitPrefab.gameObject, iconkitPrefab.gameObject.transform.parent);
|
||||
clone.name = "Prefab";
|
||||
clone.SetActive(true);
|
||||
});
|
||||
|
||||
if (Tools.GetLevelInfo().level < 3) {
|
||||
iconMarketplaceButton.interactable = false;
|
||||
|
||||
@@ -4,16 +4,16 @@ using TMPro;
|
||||
using Unity.VisualScripting;
|
||||
using UnityEngine;
|
||||
using UnityEngine.InputSystem;
|
||||
using UnityEngine.SceneManagement;
|
||||
using UnityEngine.UI;
|
||||
|
||||
public class Iconsmenu : MonoBehaviour {
|
||||
public class IconkitPrefab : MonoBehaviour {
|
||||
[SerializeField] private GameObject iconsPanel;
|
||||
[SerializeField] private GameObject overlaysPanel;
|
||||
[SerializeField] private GameObject marketplaceIconsPanel;
|
||||
[SerializeField] private GameObject marketplaceIconsContent;
|
||||
[SerializeField] private GameObject marketplaceIconsSample;
|
||||
[SerializeField] private Sprite defaultIcon;
|
||||
[SerializeField] private Button backButton;
|
||||
[SerializeField] private Button placeholderButton;
|
||||
[SerializeField] private TMP_Text selectionText;
|
||||
[SerializeField] private Image previewBird;
|
||||
@@ -88,6 +88,7 @@ public class Iconsmenu : MonoBehaviour {
|
||||
int index = i;
|
||||
overlays[i].onClick.AddListener(() => SelectOverlay(index));
|
||||
}
|
||||
backButton.onClick.AddListener(() => Destroy(gameObject));
|
||||
}
|
||||
|
||||
private void SwitchToIcon() {
|
||||
@@ -204,8 +205,8 @@ public class Iconsmenu : MonoBehaviour {
|
||||
}
|
||||
}
|
||||
|
||||
async void Update() {
|
||||
if (Keyboard.current.escapeKey.wasPressedThisFrame) await SceneManager.LoadSceneAsync("MainMenu");
|
||||
void Update() {
|
||||
if (Keyboard.current.escapeKey.wasPressedThisFrame && backButton.interactable) backButton.onClick.Invoke();
|
||||
}
|
||||
|
||||
void RenderIcons() {
|
||||
File renamed without changes.
Reference in new issue
Block a user