CloseGameButton.cs 361 B

12345678910111213141516171819
  1. using UnityEditor;
  2. using UnityEngine;
  3. public class CloseGameButton : MonoBehaviour
  4. {
  5. // Start is called once before the first execution of Update after the MonoBehaviour is created
  6. void Start()
  7. {
  8. }
  9. private void OnTriggerEnter(Collider other)
  10. {
  11. Destroy(other.gameObject);
  12. //EditorApplication.ExitPlaymode();
  13. Application.Quit();
  14. }
  15. }