Пример #1
0
    /// <summary>
    /// 크리쳐 아이콘 프리팹에는 패널을 붙이지 않아서 패널을 붙이고 싶을때 쓰임.
    /// iParentPanelDepth 인자로 부모 패널의 뎁스를 꼭 넣어주자...
    /// </summary>
    /// <param name="iPanelDepth"></param>
    public void AddPanel(int iParentPanelDepth)
    {
        UIPanel uiParentPanel = UtilFunc.GetParentPanel(transform);

        if (uiParentPanel != null)
        {
            iParentPanelDepth = uiParentPanel.depth;
        }

        UIPanel uiPanel = gameObject.GetComponent <UIPanel>();

        if (uiPanel == null)
        {
            uiPanel = gameObject.AddComponent <UIPanel>();
        }

        UtilFunc.SetPanelDepth(uiPanel, iParentPanelDepth + 10);
    }