using UnityEngine;
using System.Collections;
public class Exit : MonoBehaviour {
AndroidJavaClass mJc;
AndroidJavaObject mJo;
public Texture2D normal;
public Texture2D actived;
public string levelName;
public AudioClip sfxButton;
private bool ready;
void Start () {
mJc=new AndroidJavaClass("com.unity3d.player.UnityPlayer");
mJo=mJc.GetStatic<AndroidJavaObject>("currentActivity");
}
void OnMouseDown(){
this.guiTexture.texture = actived;
if(sfxButton != null)
AudioSource.PlayClipAtPoint(sfxButton,transform.position);
}
void OnMouseUpAsButton(){
mJo.Call("exit"); //show spot
this.guiTexture.texture = normal;
//Application.Quit();
}
void OnMouseExit(){
this.guiTexture.texture = normal;
}
}
using System.Collections;
public class Exit : MonoBehaviour {
AndroidJavaClass mJc;
AndroidJavaObject mJo;
public Texture2D normal;
public Texture2D actived;
public string levelName;
public AudioClip sfxButton;
private bool ready;
void Start () {
mJc=new AndroidJavaClass("com.unity3d.player.UnityPlayer");
mJo=mJc.GetStatic<AndroidJavaObject>("currentActivity");
}
void OnMouseDown(){
this.guiTexture.texture = actived;
if(sfxButton != null)
AudioSource.PlayClipAtPoint(sfxButton,transform.position);
}
void OnMouseUpAsButton(){
mJo.Call("exit"); //show spot
this.guiTexture.texture = normal;
//Application.Quit();
}
void OnMouseExit(){
this.guiTexture.texture = normal;
}
}