- Home /
Writing Resume, menu and exit scripts,CREATING MENU, RESUME, EXIT BUTTON IN UNITY
my startGame button and pause button are actually working on Unity. However my resume, menu and Exit button just Show on the screen without functioning. How do i correct the Code? How can i write add a Code without Application. loadlevel. I didnt have to create a new Scene for my game logo and menu but my Scene was added as a game object. hier is my Code can someone help me out? public class menuuiManager : MonoBehaviour {
// Start is called before the first frame update
void Start()
{
Time.timeScale = 0;
}
// Update is called once per frame
void Update()
{
}
public void StartGame()
{
Time.timeScale = 1;
}
public void TogglePause()
{
if(Time.timeScale == 1)
{
Time.timeScale = 0;
}
else if(Time.timeScale == 0)
{
Time.timeScale = 1;
}
}
public void Resume()
{
Time.timeScale = 1f;
}
public void Menu()
{
Time.timeScale = 1;
}
public void QuitGame()
{
Application.Quit();
Debug.Log("Game is exiting");
}
}
What did i get wrong and can someone correct my mistakes, especially with the rresume, menu and Exit button. Under canvas is where i created a gameobject start screen. Will like my game to return to the start screen with my game logo when the Exit buton is pressed. Do i write an Application.LoadStartScreen Code? i´M not really a good programmer
Your answer
