Android back button now has home button functionality
This commit is contained in:
@@ -34,7 +34,11 @@ namespace RothenburgAR.UI
|
|||||||
|
|
||||||
if (Input.GetKeyDown(KeyCode.Escape))
|
if (Input.GetKeyDown(KeyCode.Escape))
|
||||||
{
|
{
|
||||||
Application.Quit();
|
if (Application.platform == RuntimePlatform.Android)
|
||||||
|
{
|
||||||
|
AndroidJavaObject activity = new AndroidJavaClass("com.unity3d.player.UnityPlayer").GetStatic<AndroidJavaObject>("currentActivity");
|
||||||
|
activity.Call<bool>("moveTaskToBack", true);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
BIN
RothenburgAR.apk
BIN
RothenburgAR.apk
Binary file not shown.
Reference in New Issue
Block a user