Roses/Assets/Scripts/View/CloseButton.cs
2024-04-12 16:25:32 +02:00

20 lines
No EOL
352 B
C#

using UnityEngine;
using UnityEngine.UI;
namespace View {
public class CloseButton : MonoBehaviour {
private Button _button;
private void Start() {
_button = GetComponent<Button>();
_button.onClick.AddListener(CloseClicked);
}
private void CloseClicked() {
#if UNITY_EDITOR
Debug.Log("Quit");
#endif
Application.Quit();
}
}
}