光组件在 Unity 中的 Image 后面 [英] The light component is behind Image in Unity

查看:29
本文介绍了光组件在 Unity 中的 Image 后面的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有两种不同的画布:一种用于背景,一种用于游戏场景

I have two different canvases: one for the background and one for the game scene

主要画布:

背景画布:

我遇到了这个问题:如果我将一个对象放在主画布中,一切似乎都可以正常工作,但是如果我向该对象添加一个光组件,我将看不到光(就像背景图像一样在光前):

I'm having this problem: If I put an object in the principal canvas, everything seems to works but If I add a light component to this object, I'll not see the light (it is like the background image is ahead the light):

没有背景画布:

使用背景画布:

知道为什么吗?

(不是BGcanvas的问题,问题是BGcanvas的图像组件,如果我禁用它,我可以看到灯)

(The problem is not the BGcanvas, the problem is the image component of the BGcanvas, if I disable it, I can see the light)

推荐答案

灯光是 3D 场景对象

UI 对象不受灯光或场景对象的影响,因为它们存在于完全不同的渲染路径中:

Lights are 3D scene objects

UI objects are not effected by lights or scene objects because they exist in a completely different rendering path:

这篇关于光组件在 Unity 中的 Image 后面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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