Esempio n. 1
0
        // End the 2D GUI.
        internal static void EndContainerGUI(Event evt, Rect layoutSize)
        {
            if (Event.current.type == EventType.Layout &&
                s_ContainerStack.Count > 0)
            {
                GUILayoutUtility.LayoutFromContainer(layoutSize.width, layoutSize.height);
            }
            // restore cache
            GUILayoutUtility.SelectIDList(GUIUtility.s_OriginalID, false);
            GUIContent.ClearStaticCache();

            if (s_ContainerStack.Count > 0)
            {
                IMGUIContainer container = s_ContainerStack.Peek();
                if (s_EndContainerCallback != null)
                {
                    s_EndContainerCallback(container);
                }
            }

            evt.CopyFrom(Event.current);

            if (s_ContainerStack.Count > 0)
            {
                GUIUtility.EndContainer();
                s_ContainerStack.Pop();
            }
        }
Esempio n. 2
0
        internal static void EndContainerGUI(Event evt, Rect layoutSize)
        {
            bool flag = Event.current.type == EventType.Layout && UIElementsUtility.s_ContainerStack.Count > 0;

            if (flag)
            {
                GUILayoutUtility.LayoutFromContainer(layoutSize.width, layoutSize.height);
            }
            GUILayoutUtility.SelectIDList(GUIUtility.s_OriginalID, false);
            GUIContent.ClearStaticCache();
            bool flag2 = UIElementsUtility.s_ContainerStack.Count > 0;

            if (flag2)
            {
                IMGUIContainer obj   = UIElementsUtility.s_ContainerStack.Peek();
                bool           flag3 = UIElementsUtility.s_EndContainerCallback != null;
                if (flag3)
                {
                    UIElementsUtility.s_EndContainerCallback(obj);
                }
            }
            evt.CopyFrom(Event.current);
            bool flag4 = UIElementsUtility.s_ContainerStack.Count > 0;

            if (flag4)
            {
                GUIUtility.EndContainer();
                UIElementsUtility.s_ContainerStack.Pop();
            }
        }
 internal static void EndContainerGUI()
 {
     if (Event.current.type == EventType.Layout && UIElementsUtility.s_ContainerStack.Count > 0)
     {
         Rect layout = UIElementsUtility.s_ContainerStack.Peek().layout;
         GUILayoutUtility.LayoutFromContainer(layout.width, layout.height);
     }
     GUILayoutUtility.SelectIDList(GUIUtility.s_OriginalID, false);
     GUIContent.ClearStaticCache();
     if (UIElementsUtility.s_ContainerStack.Count > 0)
     {
         GUIUtility.EndContainer();
         UIElementsUtility.s_ContainerStack.Pop();
     }
 }
 internal static void EndContainerGUI()
 {
     if (Event.current.type == EventType.Layout && UIElementsUtility.s_ContainerStack.Count > 0)
     {
         Rect globalBound = UIElementsUtility.s_ContainerStack.Peek().globalBound;
         GUILayoutUtility.LayoutFromContainer(globalBound.width, globalBound.height);
     }
     GUILayoutUtility.SelectIDList(GUIUtility.s_OriginalID, false);
     GUIContent.ClearStaticCache();
     if (UIElementsUtility.s_ContainerStack.Count > 0)
     {
         IMGUIContainer obj = UIElementsUtility.s_ContainerStack.Peek();
         if (UIElementsUtility.s_EndContainerCallback != null)
         {
             UIElementsUtility.s_EndContainerCallback(obj);
         }
         GUIUtility.EndContainer();
         UIElementsUtility.s_ContainerStack.Pop();
     }
 }