void OnGUI()
{
if (GUI.Button(new Rect(300, 50, 100, 30), "隐藏UI层"))
{
UICameta.cullingMask &= ~(1 << LayerMask.NameToLayer("UI"));
}
if (GUI.Button(new Rect(300, 100, 100, 30), "显示"))
{
UICameta.cullingMask |= (1 << LayerMask.NameToLayer("UI"));
}
if (GUI.Button(new Rect(300, 100, 100, 30), "全部隐藏"))
{
UICameta.cullingMask = ~(1 << LayerMask.NameToLayer("UI"));
}
}
Unity3D 摄像机cullingMask操作
最新推荐文章于 2024-06-16 20:20:28 发布