void CheckRootLayouter()
    {
        GUILayouter targetLayouter = (GUILayouter)target;

        targetLayouter.IsRootLayouter = true;

        GUILayoutCell[] parentCells = targetLayouter.GetComponentsInParent <GUILayoutCell>(true);

        foreach (var cell in parentCells)
        {
            if (cell.LayoutHandlerObjects.Contains(targetLayouter.gameObject))
            {
                targetLayouter.IsRootLayouter = false;
            }
        }
    }
Exemple #2
0
    public static GUILayoutCell GetParentCell(GUILayouter layouter)
    {
        GUILayoutCell[] cells = layouter.GetComponentsInParent <GUILayoutCell>();

        foreach (var c in cells)
        {
            foreach (var obj in c.LayoutHandlerObjects)
            {
                if (obj == layouter.gameObject)
                {
                    return(c);
                }
            }
        }

        return(null);
    }