Unity 2D Quit Button Tutorial | Unity Tutorial
In this video tutorial, we'll walk you through the process of adding a functional Quit button to your Unity 2D game. You'll learn how to create and style a button using Unity's UI tools, and then we'll dive into scripting to make sure the button properly exits the game when clicked. By the end of this tutorial, you'll have a polished and professional Quit button ready for your 2D game project!
WATCH FULL TUTORIAL ON YOUTUBE
=========================================================
Unity Projects - ON SALE!!!
1. Water Sort Puzzle 9000 Levels
2. Ball Sort Puzzle 9000 Levels
3. Sling Shot
=========================================================
Script:
QuitButton.cs
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class QuitButton : MonoBehaviour
{
public void QuitGame()
{
Application.Quit();
Debug.Log("Quit");
}
}