返回键被unity拦截

1、使用按钮返回

if (Input.GetKeyDown(KeyCode.Escape))

{

//退出游戏

}

2、修改Inupt的参数:Input.backButtonLevelsApp = true; 

选自官方文档

Should Back button quit the application?
Only usable on Android, Windows Phone or Windows Tablets.

By default this property is set to false, which means you're responsible for responding to Back button. You can do this by calling Input.GetKey and passing KeyCode.Escape.
If you set this property to true, clicking Back button:
* On Android will terminate the application.
* On Windows Phone or Table will suspend the application.

猜你喜欢

转载自blog.csdn.net/th2017102802/article/details/103223168