You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

32 lines
1.1 KiB

// --------------------------------------------------------------------------------------------------------------------
// <copyright file="OnJoinedInstantiate.cs" company="Exit Games GmbH">
// Part of: Photon Unity Utilities,
// </copyright>
// <summary>
// This component will quit the application when escape key is pressed
// </summary>
// <author>developer@exitgames.com</author>
// --------------------------------------------------------------------------------------------------------------------
using UnityEngine;
using System.Collections;
using System.Diagnostics;
namespace Photon.Pun.UtilityScripts
{
/// <summary>
/// This component will quit the application when escape key is pressed
/// </summary>
public class OnEscapeQuit : MonoBehaviour
{
[Conditional("UNITY_ANDROID"), Conditional("UNITY_IOS")]
public void Update()
{
// "back" button of phone equals "Escape". quit app if that's pressed
if (Input.GetKeyDown(KeyCode.Escape))
{
Application.Quit();
}
}
}
}