#Alright! I have to leave now in 10

1 messages ยท Page 1 of 1 (latest)

gaunt cove
#

here

pastel scaffold
#

Alright!

#

I am gonna send you the code now

#
{
    yield return new WaitForSecondsRealtime(loadDelay);
    
    if (gameManager.currentState == GameManager.GameState.Paused)
    {
        gameManager.currentState = GameManager.GameState.Playing;
        gameManager.pauseMenuScreen.SetActive(false);
        audioManager.mainGameMusicAudioSource.UnPause();
        Debug.Log("Continue button is pressed and pause menu screen gone!");
    }
}```
gaunt cove
#

so we have buttons right:

pastel scaffold
#

Here is the code for resume button

#

yeah

gaunt cove
#

how do you pause ?

#

with a button or key ?

pastel scaffold
#

I am pausing with a key and unpausing with both

gaunt cove
#

show the UI for pause button

#

real quick

pastel scaffold
#

I am pausing with a key Escape and unpausing with Escape and resume button

gaunt cove
#

ah

#

arl

pastel scaffold
#

It is a game object

#

Where I am disabling and enabling it

#
 {
     StartCoroutine(ContinueGameAfterDelay());
 }


 IEnumerator ContinueGameAfterDelay()
 {
     yield return new WaitForSecondsRealtime(loadDelay);
     
     if (gameManager.currentState == GameManager.GameState.Paused)
     {
         gameManager.currentState = GameManager.GameState.Playing;
         gameManager.pauseMenuScreen.SetActive(false);
         audioManager.mainGameMusicAudioSource.UnPause();
         Debug.Log("Continue button is pressed and pause menu screen gone!");
     }
 }

 public void InputForPauseMenuScreen()
 {
     // Check the current game state!
     if (gameManager != null && gameManager.currentState != GameManager.GameState.GameOver)
     {
         if (Input.GetKeyDown(KeyCode.Escape))
         {
             if (gameManager.currentState == GameManager.GameState.Playing)
             {
                 gameManager.PauseGame();
             }

             else
             {
                 gameManager.ResumeGame();
             }      
         }
     }```
#

Here is the code for resume button and input for pause menu with the escape button

gaunt cove
#

by default your button doesnt have that colour

#

right ?

pastel scaffold
#

by default it has the white color

gaunt cove
#

and colour changes only when you click resume

#

first time but never reverts

#

to its original white correct ?

pastel scaffold
#

I will try to send you video now give me a minute

gaunt cove
#

and you dont assign colour anywhere in script ye

#

aye

#

if u want u can call me

#

and share screen tbh

#

that be quicker

#

if u short on time ๐Ÿ˜„

pastel scaffold
#

Next time if I will have a problem we will join I am leaving like 10:30 I will add you you seem to be a nice guy ๐Ÿ˜ƒ