Unity AR UI 未显示
我创建了一个简单的 Unity AR Foundation 应用程序,只要触摸屏幕,它就会将对象放置在平面上。我想添加一些用户界面,以便用户可以按下按钮而不是屏幕上的任何位置。
我遵循了几个不同的教程,它们似乎在做几乎相同的事情。我右键单击层次结构 ->用户界面->按钮。我已经对其进行了缩放,使其适合我的手机屏幕,并将其固定在中心,以便很容易找到。
这些是画布设置:
UI 是否可能以某种方式隐藏在来自 AR Session Origin 的摄像头源后面 -> AR相机?我是否缺少将 UI 锚定到屏幕的任何步骤?
正如您可能知道的那样,我对 Unity 非常陌生,但我感觉我已经按照教程创建了 UI,但它根本不会显示。如果您需要更多信息,请询问,我会提供。
I have created a simple Unity AR Foundation app which places objects on a plane whenever the screen is touched. I would like to add some UI so the user can press a button rather than anywhere on the screen.
I have followed several different tutorials which seem to be doing mostly the same thing. I right-click the Hierarchy -> UI -> Button. I have scaled it so it should fit my mobile screen and anchored it to the center so it should be easy enough to find.
These are the canvas settings:
Might the UI somehow be hidden behind the camera feed from the AR Session Origin -> AR Camera? Am I missing any steps to anchor the UI to the screen?
As you can probably tell, I am very new to Unity but I feel like I have followed the tutorials for creating a UI, but it simply won't show. If you need more information, please just ask and I will provide.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我正在编译错误的场景。我有两个非常相似的场景,所以当我编译时,我没有意识到没有任何变化,并且我正在检查完全错误的场景。
一旦我改变到正确的场景,上面的设置就按预期工作了。
I was compiling the wrong scene. I had two very similar scenes, so when I compiled I didn't realize there were no changes and that I was inspecting the entirely wrong scene.
Once I changed to the correct scene the setup above worked as expected.
不确定,但听起来您可能需要使用 Canvas Scalar 来根据屏幕尺寸进行缩放。将 UI 缩放模式更改为随屏幕尺寸缩放。
Not sure but sounds like you might need to have that Canvas Scalar to scale with the screen size. Change the UI scale mode to Scale with Screen Size.