Android 与 Unity交互一般是在Unity中做三维场景,然后导出成Android Project,之后在Android中把Unity场景展示出来。
刚接触这方面的时候必会遇到的问题就是:按Android自带的back返回键不能退出应用。网上搜了很多博客,绝大部分都是调用UnityPlayer中的quit()方法。
那么我们来看看这个quit()方法:
public void quit() {
this.k = true;
if(!this.e.e()) {
this.pause();
}
this.a.a();
try {
this.a.join(4000L);
} catch (InterruptedException var1) {
this.a.interrupt();
}
if(this.g != null) {
this.h.unregisterReceiver(this.g);
}
this.g = null;
if(h.c()) {
354



被折叠的 条评论
为什么被折叠?



