Change size here & change exit button logic
This commit is contained in:
2 files changed
+9
-6
No files matched your search
@@ -2,7 +2,6 @@ using System;
|
||||
using TMPro;
|
||||
using UnityEngine;
|
||||
using UnityEngine.InputSystem;
|
||||
using UnityEngine.SceneManagement;
|
||||
using UnityEngine.UI;
|
||||
|
||||
public class StatsMenu : MonoBehaviour {
|
||||
@@ -28,6 +27,8 @@ public class StatsMenu : MonoBehaviour {
|
||||
|
||||
[SerializeField] private RectTransform progressFilledRect;
|
||||
|
||||
[SerializeField] private Button exitButton;
|
||||
|
||||
void Start() {
|
||||
normalBerryStat.text = Tools.FormatWithCommas(BazookaManager.Instance.GetGameStoreTotalNormalBerries());
|
||||
poisonBerryStat.text = Tools.FormatWithCommas(BazookaManager.Instance.GetGameStoreTotalPoisonBerries());
|
||||
@@ -82,10 +83,12 @@ public class StatsMenu : MonoBehaviour {
|
||||
SetXPProgressFilled((int)percentDone);
|
||||
|
||||
Tools.RefreshHierarchy(panel);
|
||||
|
||||
exitButton.onClick.AddListener(() => Destroy(gameObject));
|
||||
}
|
||||
|
||||
async void Update() {
|
||||
if (Keyboard.current.escapeKey.wasPressedThisFrame) await SceneManager.LoadSceneAsync("MainMenu");
|
||||
void Update() {
|
||||
if (Keyboard.current.escapeKey.wasPressedThisFrame && exitButton.interactable) exitButton.onClick.Invoke();
|
||||
}
|
||||
|
||||
void SetXPProgressFilled(int progress) {
|
||||
|
||||
Reference in new issue
Block a user