团结3D UI按键不灵的移动设备 [英] Unity 3D UI Buttons not working on mobile device

查看:137
本文介绍了团结3D UI按键不灵的移动设备的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有关几天,我遇到一个奇怪的问题,当我建立,即使他们在编辑器中的工作就好了移动设备上运行我的游戏我的按钮不起作用。什么是更令人惊讶的是只放在实际游戏水平不工作的按钮。之前的菜单屏幕和工作。

For few days I'm encountering a strange problem that my buttons don't work when I build and run my game on the mobile device even though they work just fine in the editor. What's even more surprising is only the buttons that are placed for the actual gameplay level don't work. All buttons prior to that level on the menu screens and work.

这个问题才开始前,有没有这样的事发生前几天。我工作围绕这一问题,首先建立游戏方向景观左',然后再以自动旋转建设,并在播放器设置,反之亦然检查'景观左复选框。这将使按钮在移动设备上重新工作。但今天,当我建立第二个层次,我发现,这个问题也发生在第二级,即使我把它在第一级工作。

This problem only started occurring a couple of days ago before that there was no such thing. I worked around this problem by first building the game with Orientation 'Landscape Left' and then again building it with 'Auto Rotation' and checking the 'Landscape Left' checkbox in the player settings or vice versa. That will make buttons work again on the mobile device. But today when I build a second level I found that this problem also occur on Second level even though I made it to work on first level.

它的驾驶我疯了,我不知道该怎么办。菜单和游戏级别之间的唯一区别是,在游戏的水平,我将使用实例化使用某些对象的对象。

It's driving me crazy, I don't know what to do. The only difference between Menu and gameplay level is that on the gameplay level I'm placing objects using some objects using Instantiate.

是的,我已经检查我已经放在的EventSystem在画布上的水平和GraphicsRaycaster脚本。
任何想法?

Yes, I have checked I have placed the EventSYstem on the level and GraphicsRaycaster script on the canvas. Any ideas?

推荐答案

好吧,我已经找到了问题。我使用的是帆布画布内既有光线投射脚本应用到它。从孩子的画布取出光线投射脚本出现已经解决了这个问题。

Okay, I have found the problem. I was using a canvas within a canvas and both has raycasting script applied to it. Removing the ray casting script from the child canvas appears to have solved the issue.

这篇关于团结3D UI按键不灵的移动设备的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆