问题描述
我试图在 this tutorial 的帮助下在我的主菜单中实现一种缩小效果。
这带来了很多问题,因为其他 Unity 组件似乎不喜欢这个解决方案。但是大多数问题都可以通过一种或另一种方式解决,但是我在这个问题上遇到了严重的麻烦:我试图在蒙版外放置一个滚动矩形(因为它是倒置的)但是因为你不应该能够在遮罩外拖动项目我的项目在可见时不可拖动。
我尝试过使用普通图像而不是反转图像,只移除了蒙版,因此似乎没有任何面板或类似物阻挡光线投射。 我也试过删除滚动视图 - 视口蒙版,但仍然没有......
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Rendering;
using UnityEngine.UI;
public class CutoutMaskUI : Image
{
public override Material materialForRendering
{
get
{
Material material = new Material(base.materialForRendering);
material.SetInt("_StencilComp",(int)CompareFunction.NotEqual);
return material;
}
}
}
(如果我提供的信息太少,请告诉我,我会尝试添加更多)
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)