예제 #1
0
        private void SetGameViewResolution(int width, int height)
        {
            int idx = GameViewUtils.FindSize(GameViewUtils.GetCurrentGroupType(), width, height);

            if (idx != -1)
            {
                GameViewUtils.SetSize(idx);
            }
        }
예제 #2
0
        public void SetResolution(string resolutionName, Vector2 newResolution)
        {
            UIStoryboard storyboard = (UIStoryboard)target;

            storyboard.SetResolution(newResolution);

            int width  = Mathf.FloorToInt(newResolution.x);
            int height = Mathf.FloorToInt(newResolution.y);

            //gameview
            if (GameViewUtils.SizeExists(GameViewUtils.GetCurrentGroupType(), width, height))
            {
                SetGameViewResolution(width, height);
            }
            else
            {
                //size doesnt exist yet, create it
                GameViewUtils.AddCustomSize(GameViewUtils.GameViewSizeType.FixedResolution, GameViewUtils.GetCurrentGroupType(), width, height, resolutionName);
                SetGameViewResolution(width, height);
            }
        }