unity android back button
using UnityEngine.SceneManagement;
void Update()
{
if (Input.GetKey(KeyCode.Escape))
{
SceneManager.LoadScene("Main Menu");
}
}
unity android back button
using UnityEngine.SceneManagement;
void Update()
{
if (Input.GetKey(KeyCode.Escape))
{
SceneManager.LoadScene("Main Menu");
}
}
unity android back button
public class RrAndroidBackButton : MonoBehaviour {
public static RrAndroidBackButton instance;
void Awake() {
if (null == instance) {
instance = this;
DontDestroyOnLoad(this.gameObject);
} else {
Destroy(gameObject);
}
}
void FiexdUpdate () {
if (Application.platform == RuntimePlatform.Android){
if (Input.GetKey(KeyCode.Escape)) {
Application.Quit();
System.Diagnostics.Process.GetCurrentProcess().Kill();
AndroidJavaObject activity = new AndroidJavaClass("com.unity3d.player.UnityPlayer")
.GetStatic<AndroidJavaObject>("currentActivity");
activity.Call<bool>("moveTaskToBack", true);
}
}
}
}
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us