gpt4 book ai didi

android - 为什么Unity打开其他应用后又回到android下的Unity后Unity的功能被阻止了

转载 作者:行者123 更新时间:2023-11-29 01:30:32 25 4
gpt4 key购买 nike

首先,我使用 Unity 打开一个 webview(通过名为“uniwebview”的插件)。然后我打开相机或画廊(通过 stan 的 android native 插件)或浏览器(通过 Application.OpenURL(url))。在我选择图片并返回统一之后。如果 adb 日志是这样的:

I/Unity   (12779): onPause          //open camera and Unity pause
I/Unity (12779): windowFocusChanged: true // after take picture, windowFocusChanged set true and unity resume
I/Unity (12779): onResume
I/Unity (12779): OnAndroidRetrieveProductsFinished

然后 Unity 工作正常,但有时如果 adb 日志如下:

I/Unity   (12779): onPause
I/Unity (12779): onResume

Unity 的功能将被阻止。我在Unity 中编写的代码将无法运行,但webview 仍然可以正常运行。我在Unity中反编译classes.jar,发现函数windowFocusChanged:

public void windowFocusChanged(final boolean paramBoolean)
{
i.Log(4, "windowFocusChanged: " + paramBoolean);
this.i.a(paramBoolean);
if ((paramBoolean) && (this.b != null)) {
reportSoftInputStr(null, 1, false);
}
c(new Runnable()
{
public final void run()
{
UnityPlayer.a(UnityPlayer.this, paramBoolean);
}
});
this.a.a(paramBoolean);
g();
}

但我不知道为什么这个功能不起作用。 classes.jar 已被混淆并且难以阅读。

最佳答案

我不知道它如何与我们使用的“Native Gallery Assist”插件一起使用 - https://www.assetstore.unity3d.com/en/#!/content/60922这会很好地恢复与所选图像的统一...

关于android - 为什么Unity打开其他应用后又回到android下的Unity后Unity的功能被阻止了,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31467766/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com