Skip to content

Instantly share code, notes, and snippets.

@Norlself
Created March 21, 2015 02:21
Show Gist options
  • Save Norlself/5a424d9b4aa86260ec79 to your computer and use it in GitHub Desktop.
Save Norlself/5a424d9b4aa86260ec79 to your computer and use it in GitHub Desktop.
Unity1 ExitEvent.cs
using UnityEngine;
using UnityEngine.UI;
using System.Collections;
public class ExitEvent : MonoBehaviour {
// Use this for initialization
void Start () {
Button btn = this.GetComponent<Button>();
btn.onClick.AddListener (() => {
Debug.Log ("Quit Application");
Application.Quit ();
});
}
// Update is called once per frame
void Update () {
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment