public static void SetGameViewSize(int width, int height)
        {
                        #if (UNITY_5_4_OR_NEWER)
            // Checks if temp size exists, creates it if needed
            if (!GameViewUtils.SizeExists(m_AspectName))
            {
                GameViewUtils.AddCustomSize(GameViewUtils.SizeType.FIXED_RESOLUTION, width, height, m_AspectName);
            }

            // Set the size of the custom size
            int size = GameViewUtils.FindSize(m_AspectName);
            if (size == -1)
            {
                Debug.LogError("Can not find the gameview size " + m_AspectName);
                return;
            }
            GameViewUtils.SetCurrentSizeIndex(size);

            // Change the size
            GameViewUtils.SetGameViewSize(width, height);
                        #else
            // Force Free aspect
            GameViewUtils.SetSize(0);

            // Change rect size
            int topOffset = 17;
            GameViewUtils.GetGameView().minSize = new Vector2(width, height + topOffset);
            GameViewUtils.GetGameView().maxSize = new Vector2(width, height + topOffset);
            GameViewUtils.SetGameViewRect(new Rect(m_PreviousRect.x, m_PreviousRect.y, width, height + topOffset));

            // Force repaint for "waitendoframe"
            GameViewUtils.GetGameView().Repaint();
                        #endif
        }