简体   繁体   English

Unity 5.3.0f4:长时间播放后,UI Button已停止在Android上运行

[英]Unity 5.3.0f4 : UI Button has stopped working on Android after playing long time

I have developed a game where all are working fine but after playing long time on Android , UI button is not calling the OnClick() function's code but change the color tint of pressed , normal and highlighted. 我已经开发了一款游戏,但一切正常,但是在Android上玩了很长时间之后,UI按钮并未调用OnClick()函数的代码,而是更改了按下,正常和突出显示的颜色。 And if I do that :- (Android) setting->apps-> [myapp Name]-> clear data then everything is working fine again.So, how can I fix this problem in Unity? 如果我这样做了:-(Android)设置->应用程序-> [myapp名称]->清除数据,那么一切都再次正常运行。那么,如何在Unity中解决此问题?

It is hard to provide any help here with no code or examples of anything. 没有代码或任何示例,在这里很难提供任何帮助。 Are you using a 3rd party UI framework like NGUI or unity's UI system? 您是否正在使用NGUI或unity的UI系统之类的第三方UI框架?

Best thing for you to do is play the game in unity for a while with mono or vs attached to Unity. 对您而言,最好的办法是将Mono或vs附加到Unity并统一播放游戏一段时间。 Once this problem replicates itself in Unity you can see whats going on in the debugger. 一旦此问题在Unity中复制后,您就可以看到调试器中发生了什么。 Or use adb to dump the log out from the phone. 或使用adb从电话中转出注销。 See: https://developer.android.com/studio/command-line/adb.html 请参阅: https//developer.android.com/studio/command-line/adb.html

If you can't replicate this problem in Unity I would report it to Unity yourself as a bug with Android builds. 如果您无法在Unity中复制此问题,我会自己将其报告为Unity,这是Android构建中的错误。

If you provide code or elaborate more on what you're exactly working with I can edit this answer later to hopefully help you. 如果您提供代码或详细说明您所使用的工具,我以后可以编辑此答案以希望对您有所帮助。

Yes! 是! I find a solution. 我找到了解决方案。 Just Go to EventSystem and Change the value of Drag Threshold from 5 to 20 and after build , I play about 6 hours and I cannot see any problem. 只需转到EventSystem并将Drag Threshold的值从5更改为20,然后在构建之后,我玩了大约6个小时,就看不到任何问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM