예제 #1
0
        /// <summary> Returns a point on the window no matter if it is currently fullscreen or non-fullscreen.</summary>
        public static Vector2 GetPointOnWindow(this EditorWindow editorWindow)
        {
            Vector2 pointOnWindow;
            var     state = FS.FindWindowState(editorWindow);

            if (state != null && state.IsFullscreen)
            {
                //When the window is fullscreen sometimes position returns incorrect co-ordinates, so use the FullscreenAtPosition for fullscreen windows.
                pointOnWindow = state.FullscreenAtPosition;
            }
            else
            {
                pointOnWindow = editorWindow.position.center;
            }
            return(pointOnWindow);
        }
예제 #2
0
 public static FS.WindowFullscreenState GetWindowFullscreenState()
 {
     return(FS.FindWindowState(null, FS.MainWindowType));
 }