/// <summary>
/// 设置按钮层级
/// </summary>
private void FnSetBtnLayer()
{
GameObject go = Rt_FuncBottom.gameObject;
Canvas ca = go.GetComponent<Canvas>();
GraphicRaycaster ray = go.GetComponent<GraphicRaycaster>();
if (ca == null)
{
ca = go.AddComponent<Canvas>();
}
if (ray == null)
{
ray = go.AddComponent<GraphicRaycaster>();
}
ca.overrideSorting = true;
ca.sortingOrder = canvasOrder + 1;
}
最后修改:2023 年 06 月 09 日
© 允许规范转载