Commit 8d528dbd authored by Yousef Sameh's avatar Yousef Sameh

pause menu hotfix

parent 638a26aa
...@@ -6,7 +6,6 @@ using Newtonsoft.Json; ...@@ -6,7 +6,6 @@ using Newtonsoft.Json;
using OneOf; using OneOf;
using Supabase.Realtime; using Supabase.Realtime;
using Supabase.Realtime.PostgresChanges; using Supabase.Realtime.PostgresChanges;
using Unity.VisualScripting;
using UnityEngine; using UnityEngine;
public class UserService public class UserService
......
...@@ -24,18 +24,24 @@ public class UIPause : MonoBehaviour ...@@ -24,18 +24,24 @@ public class UIPause : MonoBehaviour
if (quitButton != null) if (quitButton != null)
quitButton.onClick.AddListener(QuitGame); quitButton.onClick.AddListener(QuitGame);
pauseMenuCanvasGroup.gameObject.SetActive(false);
} }
private void PauseGame() private void PauseGame()
{ {
Time.timeScale = 0f; Time.timeScale = 0f;
pauseMenuCanvasGroup.gameObject.SetActive(true);
pauseMenuCanvasGroup.DOFade(1f, 0.25f).From(0f).SetUpdate(true); pauseMenuCanvasGroup.DOFade(1f, 0.25f).From(0f).SetUpdate(true);
} }
private void ResumeGame() private void ResumeGame()
{ {
Time.timeScale = 1f; Time.timeScale = 1f;
pauseMenuCanvasGroup.DOFade(0f, 0.25f).From(1f).SetUpdate(true); pauseMenuCanvasGroup.DOFade(0f, 0.25f).From(1f).SetUpdate(true).OnComplete(() =>
{
pauseMenuCanvasGroup.gameObject.SetActive(false);
});
} }
private void QuitGame() private void QuitGame()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment