Reformat code
This commit is contained in:
77 files changed
+1041
-2187
No files matched your search
@@ -5,8 +5,7 @@ using UnityEngine.InputSystem;
|
||||
using UnityEngine.SceneManagement;
|
||||
using UnityEngine.UI;
|
||||
|
||||
public class IconMarketplaceManager : MonoBehaviour
|
||||
{
|
||||
public class IconMarketplaceManager : MonoBehaviour {
|
||||
[SerializeField] private GameObject normalPanel;
|
||||
[SerializeField] private GameObject downloadPanel;
|
||||
[SerializeField] private GameObject uploadPanel;
|
||||
@@ -18,16 +17,12 @@ public class IconMarketplaceManager : MonoBehaviour
|
||||
[SerializeField] private Button uploadButton;
|
||||
[SerializeField] private TMP_Text coinText;
|
||||
|
||||
void Start()
|
||||
{
|
||||
void Start() {
|
||||
downloadPanelScript.iconPurchaseSound.volume = BazookaManager.Instance.GetSettingSFXVolume();
|
||||
downloadButton.onClick.AddListener(() => SwitchPanel(1));
|
||||
if (BazookaManager.Instance.GetAccountID() != null && BazookaManager.Instance.GetAccountName() != null && BazookaManager.Instance.GetAccountSession() != null)
|
||||
{
|
||||
if (BazookaManager.Instance.GetAccountID() != null && BazookaManager.Instance.GetAccountName() != null && BazookaManager.Instance.GetAccountSession() != null) {
|
||||
uploadButton.onClick.AddListener(() => SwitchPanel(2));
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
uploadButton.interactable = false;
|
||||
uploadButton.transform.GetChild(0).transform.localPosition = new Vector3(0, 10, 0);
|
||||
uploadButton.transform.GetChild(1).GetComponent<TMP_Text>().text = "Not logged in to an account";
|
||||
@@ -35,15 +30,13 @@ public class IconMarketplaceManager : MonoBehaviour
|
||||
SwitchPanel(0);
|
||||
}
|
||||
|
||||
internal void SwitchPanel(int panelIndex)
|
||||
{
|
||||
internal void SwitchPanel(int panelIndex) {
|
||||
downloadPanelScript.iconPurchaseSound.Stop();
|
||||
downloadPanelScript.anyChanges = false;
|
||||
downloadPanelScript.optionsPanelSortByDropdown.value = 3;
|
||||
downloadPanelScript.optionsPanelPriceRangeToggle.isOn = false;
|
||||
downloadPanelScript.optionsPanelSearchForToggle.isOn = false;
|
||||
switch (panelIndex)
|
||||
{
|
||||
switch (panelIndex) {
|
||||
case 0:
|
||||
coinText.text = "You have " + Tools.FormatWithCommas(BazookaManager.Instance.GetCustomBirdIconData().Balance) + " coins";
|
||||
normalPanel.SetActive(true);
|
||||
@@ -52,10 +45,8 @@ public class IconMarketplaceManager : MonoBehaviour
|
||||
if (DiscordRPCHandler.Instance != null) DiscordRPCHandler.Instance.UpdateRPC("Choosing what to do in the icon marketplace", null);
|
||||
break;
|
||||
case 1:
|
||||
foreach (Transform item in downloadPanelScript.content.transform)
|
||||
{
|
||||
if (item.gameObject.activeSelf)
|
||||
{
|
||||
foreach (Transform item in downloadPanelScript.content.transform) {
|
||||
if (item.gameObject.activeSelf) {
|
||||
Destroy(item.gameObject);
|
||||
}
|
||||
}
|
||||
@@ -75,15 +66,12 @@ public class IconMarketplaceManager : MonoBehaviour
|
||||
}
|
||||
}
|
||||
|
||||
async void Update()
|
||||
{
|
||||
if (Keyboard.current.escapeKey.wasPressedThisFrame)
|
||||
{
|
||||
async void Update() {
|
||||
if (Keyboard.current.escapeKey.wasPressedThisFrame) {
|
||||
if (downloadPanelScript.optionsPanel.activeSelf) downloadPanelScript.optionsPanelSubmitButton.onClick.Invoke();
|
||||
else if (uploadPanel.activeSelf && FileBrowser.IsOpen) return;
|
||||
else if (downloadPanel.activeSelf || uploadPanel.activeSelf) SwitchPanel(0);
|
||||
else await SceneManager.LoadSceneAsync("MainMenu");
|
||||
}
|
||||
else if (Keyboard.current.rKey.wasPressedThisFrame && downloadPanel.activeSelf && downloadPanelScript.refreshButton.interactable) downloadPanelScript.GetIcons();
|
||||
} else if (Keyboard.current.rKey.wasPressedThisFrame && downloadPanel.activeSelf && downloadPanelScript.refreshButton.interactable) downloadPanelScript.GetIcons();
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user