Make play menu into a popup
This commit is contained in:
32 files changed
+9895
-10304
No files matched your search
@@ -14,7 +14,8 @@ public class MainMenu : MonoBehaviour {
|
||||
[SerializeField] private ProfileMenu profilePrefab;
|
||||
[SerializeField] private AccountHandler accountsPrefab;
|
||||
[SerializeField] private SettingsMenu settingsPrefab;
|
||||
[SerializeField] private StatsMenu statsPrefab;
|
||||
[SerializeField] private StatsPrefab statsPrefab;
|
||||
[SerializeField] private PlayModePrefab playModePrefab;
|
||||
[SerializeField] private TMP_Text copyrightText;
|
||||
[SerializeField] private GameObject closePopup;
|
||||
[SerializeField] private Button closePopupCancelButton;
|
||||
@@ -24,6 +25,7 @@ public class MainMenu : MonoBehaviour {
|
||||
[SerializeField] private Button accountsButton;
|
||||
[SerializeField] private Button settingsButton;
|
||||
[SerializeField] private Button statsButton;
|
||||
[SerializeField] private Button playButton;
|
||||
|
||||
void Awake() {
|
||||
if (PresistentData.latestVersion != null) {
|
||||
@@ -82,6 +84,11 @@ public class MainMenu : MonoBehaviour {
|
||||
clone.name = "Prefab";
|
||||
clone.SetActive(true);
|
||||
});
|
||||
playButton.onClick.AddListener(() => {
|
||||
var clone = Instantiate(playModePrefab.gameObject, playModePrefab.gameObject.transform.parent);
|
||||
clone.name = "Prefab";
|
||||
clone.SetActive(true);
|
||||
});
|
||||
|
||||
if (Tools.GetLevelInfo().level < 3) {
|
||||
iconMarketplaceButton.interactable = false;
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 11fba61d32db34a00ad206365b097b6d
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -7,7 +7,7 @@ using UnityEngine.InputSystem;
|
||||
using UnityEngine.SceneManagement;
|
||||
using UnityEngine.UI;
|
||||
|
||||
public class PlayMenu : MonoBehaviour {
|
||||
public class PlayModePrefab : MonoBehaviour {
|
||||
[SerializeField] private GameObject selectionMenu;
|
||||
[SerializeField] private GameObject customMenu;
|
||||
[SerializeField] private GameObject autoWarningMenu;
|
||||
@@ -24,6 +24,7 @@ public class PlayMenu : MonoBehaviour {
|
||||
[SerializeField] private Button autoButton;
|
||||
[SerializeField] private Button autoBackButton;
|
||||
[SerializeField] private Button autoPlayButton;
|
||||
[SerializeField] private Button backButton;
|
||||
|
||||
[SerializeField] private TMP_InputField normalBerryChance;
|
||||
[SerializeField] private TMP_InputField poisonBerryChance;
|
||||
@@ -220,6 +221,7 @@ public class PlayMenu : MonoBehaviour {
|
||||
BazookaManager.Instance.SetReadAutoWarning(true);
|
||||
await SceneManager.LoadSceneAsync("AutoGamePlayer");
|
||||
});
|
||||
backButton.onClick.AddListener(() => Destroy(gameObject));
|
||||
|
||||
normalBerryChance.onSelect.AddListener((value) => OnSelect(value, normalBerryChance));
|
||||
normalBerryChance.onDeselect.AddListener((value) => OnDeselect(value, normalBerryChance));
|
||||
@@ -368,13 +370,13 @@ public class PlayMenu : MonoBehaviour {
|
||||
}
|
||||
}
|
||||
|
||||
async void Update() {
|
||||
void Update() {
|
||||
if (Keyboard.current.escapeKey.wasPressedThisFrame && customBackButton.interactable) {
|
||||
if (customMenu.activeSelf) customBackButton.onClick.Invoke();
|
||||
else if (autoWarningMenu.activeSelf) autoBackButton.onClick.Invoke();
|
||||
else if (multiplayerJoinStatusPanel.activeSelf) {
|
||||
if (multiplayerDeniedPanel.activeSelf) multiplayerDeniedBackButton.onClick.Invoke();
|
||||
} else await SceneManager.LoadSceneAsync("MainMenu");
|
||||
} else Destroy(gameObject);
|
||||
}
|
||||
}
|
||||
}
|
||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -4,7 +4,7 @@ using UnityEngine;
|
||||
using UnityEngine.InputSystem;
|
||||
using UnityEngine.UI;
|
||||
|
||||
public class StatsMenu : MonoBehaviour {
|
||||
public class StatsPrefab : MonoBehaviour {
|
||||
[SerializeField] private GameObject panel;
|
||||
|
||||
[SerializeField] private TMP_Text normalBerryStat;
|
||||
File renamed without changes.
Reference in new issue
Block a user