QuitOnClick.cs 257 B

123456789101112131415
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. public class QuitOnClick : MonoBehaviour
  5. {
  6. public void Quit()
  7. {
  8. #if UNITY_EDITOR
  9. UnityEditor.EditorApplication.isPlaying = false;
  10. #else
  11. Application.Quit();
  12. #endif
  13. }
  14. }