Changed pause menu to use onRelease instead of onClick

This commit is contained in:
maverickdgg 2023-03-05 14:01:30 +08:00
parent 8b24d7e32b
commit f52e5a1394
1 changed files with 3 additions and 3 deletions

View File

@ -37,7 +37,7 @@ public class PauseMenu : Script
UIElement resume = resumeBtn.GetComponent<UIElement>(); UIElement resume = resumeBtn.GetComponent<UIElement>();
if (resume != null) if (resume != null)
{ {
resume.OnClick.RegisterAction(() => resume.OnRelease.RegisterAction(() =>
{ {
if (GameManager.Instance.GamePause) if (GameManager.Instance.GamePause)
{ {
@ -61,7 +61,7 @@ public class PauseMenu : Script
UIElement retry = retryBtn.GetComponent<UIElement>(); UIElement retry = retryBtn.GetComponent<UIElement>();
if (retry != null) if (retry != null)
{ {
retry.OnClick.RegisterAction(() => retry.OnRelease.RegisterAction(() =>
{ {
Audio.StopAllSounds(); Audio.StopAllSounds();
SceneManager.RestartScene(); SceneManager.RestartScene();
@ -75,7 +75,7 @@ public class PauseMenu : Script
UIElement quit = quitBtn.GetComponent<UIElement>(); UIElement quit = quitBtn.GetComponent<UIElement>();
if (quit != null) if (quit != null)
{ {
quit.OnClick.RegisterAction(() => quit.OnRelease.RegisterAction(() =>
{ {
Audio.StopAllSounds(); Audio.StopAllSounds();
//go to main menu //go to main menu