我团结按钮为什么需要多个水龙头,终于工作? [英] Why do my Unity Buttons need multiple taps to finally work?

查看:248
本文介绍了我团结按钮为什么需要多个水龙头,终于工作?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

正如标题所暗示的,我有两个画布的屏幕。对方的逐字副本,但只要有我的纵向和横向不同的布局。由于当方向的变化,我禁用含画布适当的游戏对象。

As the title suggests, I have a screen with two canvases. Both literally a copy of each other, but simply having a different layout for my Portrait and Landscape orientations. As and when the orientation changes, I disable to appropriate Gameobject containing the Canvas.

现在,我从来没有从previous帆布开放其他按钮的任何问题,但我有这个问题,在我的活动画布需要在同一按钮上多个抽头终于工作。

Now, I've never had any problems with the other buttons from the previous canvas open, but I've got this problem where my active canvas needs multiple taps on the same button to finally WORK.

我应该做不同的东西吗?

Should I be doing something differently?

修改:有,当我测试它统一编辑器没有问题。只有当它进入到一个Android或iOS设备。

EDIT: There's no problem when I test it on Unity Editor. Only when it goes onto an Android or iOS device.

请记住,它的工作。它只是,它需要无穷无尽的尝试这样做。

Please keep in mind that it DOES work. It just that it takes endless tries to do so.

推荐答案

通常,有时-作品,有时是doesn't由两个对撞机从相机相同的距离所造成的那种点击。

Usually the kind of click that sometimes-works-sometimes-doesn't is caused by two colliders at the same distance from the camera.

试着改变按钮/帆布Z位置,看是否是这种情况。

Try changing Z-position of a button/canvas to see if this is the case.

光线投射,这是相当有可能的引擎盖下用帆布点击,仅在发送onmousedown事件事件最接近类似于对撞机。

Ray casting, which is quite likely used under the hood for canvas clicks, is only sending the onMouseDown event closest resembles colliders.

另外在画布上,如果对屏幕空间 - 摄像机调整图层的订单,所以没有两条画布是在同一层上。

Also on the Canvas, if its on Screen Space - Camera adjust the Order in Layer so that no two canvases are on the same layer.

如果在同一层有两种,它必须选择其中的任一个。看来,在这种情况下,统一选择任何一个随机

If there are two at the same layer, it has to choose either one of them. It seems that, in this case, unity chooses any one randomly.

这篇关于我团结按钮为什么需要多个水龙头,终于工作?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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