UnityEditor.ContainerWindow.Show C# (CSharp) Method

Show() public method

public Show ( ShowMode showMode, bool loadPosition, bool displayImmediately ) : void
showMode ShowMode
loadPosition bool
displayImmediately bool
return void
        public void Show(ShowMode showMode, bool loadPosition, bool displayImmediately)
        {
            if (showMode == ShowMode.AuxWindow)
            {
                showMode = ShowMode.Utility;
            }
            if ((showMode == ShowMode.Utility) || IsPopup(showMode))
            {
                this.m_DontSaveToLayout = true;
            }
            this.m_ShowMode = (int) showMode;
            if (!this.isPopup)
            {
                this.Load(loadPosition);
            }
            this.Internal_Show(this.m_PixelRect, this.m_ShowMode, this.m_MinSize, this.m_MaxSize);
            if (this.m_RootView != null)
            {
                this.m_RootView.SetWindowRecurse(this);
            }
            this.Internal_SetTitle(this.m_Title);
            this.SetBackgroundColor(skinBackgroundColor);
            this.Internal_BringLiveAfterCreation(displayImmediately, true);
            if (this != null)
            {
                this.position = this.FitWindowRectToScreen(this.m_PixelRect, true, false);
                this.rootView.position = new Rect(0f, 0f, this.m_PixelRect.width, this.m_PixelRect.height);
                this.rootView.Reflow();
                this.Save();
            }
        }

Usage Example

示例#1
0
        public void Show(Rect pixelPos, GUIContent content, Vector2 viewSize, Vector2 mouseScreenPosition)
        {
            m_Content = content;
            // scale not to be larger then maxArea pixels.
            var area = viewSize.x * viewSize.y;

            m_FullWindowSize = viewSize * Mathf.Sqrt(Mathf.Clamp01(kMaxArea / area));

            if (!m_Window)
            {
                m_Window = ScriptableObject.CreateInstance <ContainerWindow>();
                m_Window.m_DontSaveToLayout = true;
                SetMinMaxSizes(Vector2.zero, new Vector2(10000, 10000));
                SetWindowPos(pixelPos);
                m_Window.rootView = this;
            }
            else
            {
                SetWindowPos(pixelPos);
            }

            // Do not steal focus from the pane
            m_Window.Show(ShowMode.NoShadow, loadPosition: true, displayImmediately: false, setFocus: false);

            m_TargetRect = pixelPos;
        }
All Usage Examples Of UnityEditor.ContainerWindow::Show