Fixed button click state not resetting bug #398

Merged
maverickdgg merged 4 commits from SP3-20-UI-System into main 2023-03-05 14:46:18 +08:00
1 changed files with 3 additions and 3 deletions
Showing only changes of commit f52e5a1394 - Show all commits

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