internal static void ShowDetails(bool shouldReposition)
        {
            if (m_Window && m_Window.docked)
            {
                shouldReposition = false;
            }

            if (m_Window == null)
            {
                var wins = Resources.FindObjectsOfTypeAll <ProgressWindow>();
                if (wins.Length > 0)
                {
                    m_Window = wins[0];
                }
            }

            bool newWindowCreated = false;

            if (!m_Window)
            {
                m_Window         = CreateInstance <ProgressWindow>();
                newWindowCreated = true;
            }

            m_Window.Show();
            m_Window.Focus();

            if (newWindowCreated && shouldReposition)
            {
                var mainWindowRect = EditorGUIUtility.GetMainWindowPosition();
                var size           = new Vector2(WindowWidth, WindowHeight);
                m_Window.position = new Rect(mainWindowRect.xMax - WindowWidth - 6, mainWindowRect.yMax - WindowHeight - 50, size.x, size.y);
                m_Window.minSize  = size;
            }
        }
示例#2
0
        internal static void ShowAboutWindow()
        {
            var mainWindowRect = EditorGUIUtility.GetMainWindowPosition();
            var aboutRect      = EditorGUIUtility.GetCenteredWindowPosition(mainWindowRect, WindowSize);

            AboutWindow w = GetWindowWithRect <AboutWindow>(aboutRect, true, "About Unity");

            w.position = aboutRect;
            w.minSize  = w.maxSize = WindowSize;
            w.m_Parent.window.m_DontSaveToLayout = true;
        }
示例#3
0
        internal static void ShowDetails(bool shouldReposition)
        {
            if (s_Window && s_Window.docked)
            {
                shouldReposition = false;
            }

            if (s_Window == null)
            {
                var wins = Resources.FindObjectsOfTypeAll <ProgressWindow>();
                if (wins.Length > 0)
                {
                    s_Window = wins[0];
                }
            }

            bool newWindowCreated = false;

            if (!s_Window)
            {
                s_Window         = CreateInstance <ProgressWindow>();
                newWindowCreated = true;

                // If it is the first time this window is opened, reposition.
                if (!EditorPrefs.HasKey(k_CheckWindowKeyName))
                {
                    shouldReposition = true;
                }
            }

            s_Window.Show();
            s_Window.Focus();

            if (newWindowCreated && shouldReposition)
            {
                var mainWindowRect = EditorGUIUtility.GetMainWindowPosition();
                var size           = new Vector2(k_WindowWidth, k_WindowHeight);
                s_Window.position = new Rect(mainWindowRect.xMax - k_WindowWidth - 6, mainWindowRect.yMax - k_WindowHeight - 50, size.x, size.y);
                s_Window.minSize  = new Vector2(k_WindowMinWidth, k_WindowMinHeight);
            }
        }