KillSelf.cs 517 B

12345678910111213141516171819202122232425262728293031
  1. using RayNeo.Tool;
  2. using System.Collections;
  3. using System.Collections.Generic;
  4. using UnityEngine;
  5. public class KillSelf : MonoBehaviour
  6. {
  7. // Start is called before the first frame update
  8. void Start()
  9. {
  10. TouchEventCtrl.Instance.OnDoubleTap += Kill;
  11. }
  12. private void Kill()
  13. {
  14. Application.Quit();
  15. }
  16. // Update is called once per frame
  17. void Update()
  18. {
  19. }
  20. private void OnDestroy()
  21. {
  22. TouchEventCtrl.Instance.OnDoubleTap -= Kill;
  23. }
  24. }