I am building a VR application with a menu scene and many other scenes.. I would like to get back into the menu scene from any other scene when the user hits the mobiles back button (android).. What is the script for that and where should i place the script??
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
You use the Escape
keycode to detect back button press on Android.
using UnityEngine.SceneManagement;
void Update()
{
if (Input.GetKey(KeyCode.Escape))
{
SceneManager.LoadScene("Main Menu");
}
}