Beispiel #1
0
        public static GUILayoutGroup BeginLayoutGroup(GUIStyle style, GUILayoutOption[] options, Il2CppSystem.Type layoutType)
        {
            EventType      type = Event.current.type;
            GUILayoutGroup guilayoutGroup;

            if (type != EventType.Used && type != EventType.Layout)
            {
                guilayoutGroup = GUILayoutUtility.current.topLevel.GetNext().TryCast <GUILayoutGroup>();

                if (guilayoutGroup == null)
                {
                    throw new ArgumentException("GUILayout: Mismatched LayoutGroup." + Event.current.type);
                }
                guilayoutGroup.ResetCursor();
            }
            else
            {
                guilayoutGroup       = GUILayoutUtility.CreateGUILayoutGroupInstanceOfType(layoutType);
                guilayoutGroup.style = style;
                if (options != null)
                {
                    guilayoutGroup.ApplyOptions(options);
                }
                GUILayoutUtility.current.topLevel.entries.Add(guilayoutGroup);
            }
            GUILayoutUtility.current.layoutGroups.Push(guilayoutGroup);
            GUILayoutUtility.current.topLevel = guilayoutGroup;
            return(guilayoutGroup);
        }