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

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

问题描述

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

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

主要画布:

Principal canvas:

背景画布:

Background canvas:

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

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):

没有背景画布:

Without the background canvas:

使用背景画布:

With the background canvas:

有人知道为什么吗?

(问题不是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天全站免登陆