c# - 在图像后面隐藏 UI 元素
问题描述
我试图实现将我的 UI 元素(如文本、图像等)隐藏在另一个透明图像后面。问题是我使用的是最新的 Unity 版本,而这些自定义着色器对隐藏 UI 着色器没有影响。我申请测试的两个自定义着色器是:
Shader "Custom/DepthReserve"
{
Properties
{
}
SubShader
{
Tags { "RenderType" = "Opaque" "Queue"="Geometry-1" }
LOD 100
Blend Zero One
Pass
{
}
}
}
和
Shader "Custom/InvisibleMask" {
SubShader {
// draw after all opaque objects (queue = 2001):
Tags { "Queue"="Geometry+1" }
Pass {
Blend Zero One // keep the image behind it
}
}
}
那么有没有办法使用透明图像来隐藏文本、图像甚至游戏对象呢?
解决方案
推荐阅读
- javascript - 如何清除 Inquirer.js 中的错误输入
- excel - VBA 文本框无法识别小数位
- jquery - 如何在 jquery 中使用 for 循环?
- c# - 使用 JsonConvert.DeserializeObject 动态选择类
- php - Symfony 5 - 如何在服务或控制器中注入捆绑配置文件
- php - 更改带有重复项目的 WooCommerce 订单的状态
- r - 如何在r中对数字变量进行分组?
- python - 如果满足某个条件,如何跳过部分代码
- reactjs - react-svg test env:无法通过导入状态设置src
- python - Pandas groupby 和 substract 取决于条件