예제 #1
0
        /// <summary>
        /// Do the resizable window.
        /// </summary>
        private void DoResizableScreen()
        {
            int screenWidth  = Screen.width;
            int screenHeight = Screen.height;

            if (CURRENT_SCREEN_WIDTH == screenWidth &&
                CURRENT_SCREEN_HEIGHT == screenHeight)
            {
                return;
            }

            if (PREV_SCREEN_WIDTH == 0.0f || PREV_SCREEN_HEIGHT == 0.0f)
            {
                // If zero, set to the same value.
                PREV_SCREEN_WIDTH  = screenWidth;
                PREV_SCREEN_HEIGHT = screenHeight;
            }
            else
            {
                // Record previous screen info.
                PREV_SCREEN_WIDTH  = CURRENT_SCREEN_WIDTH;
                PREV_SCREEN_HEIGHT = CURRENT_SCREEN_HEIGHT;
            }

            // Update current screen info.
            CURRENT_SCREEN_WIDTH  = screenWidth;
            CURRENT_SCREEN_HEIGHT = screenHeight;

            // Do callback.
            if (onScreenResize != null)
            {
                onScreenResize.Invoke();
            }
        }
        /// <summary>
        /// Do the resizable window.
        /// </summary>
        private void DoResizableScreen()
        {
            int width  = JCS_Screen.width;
            int height = JCS_Screen.height;

            if (CURRENT_SCREEN_SIZE.width == width &&
                CURRENT_SCREEN_SIZE.height == height)
            {
                return;
            }

            if (PREV_SCREEN_SIZE.width == 0.0f || PREV_SCREEN_SIZE.height == 0.0f)
            {
                // If zero, set to the same value.
                PREV_SCREEN_SIZE.width  = width;
                PREV_SCREEN_SIZE.height = height;
            }
            else
            {
                // Record previous screen info.
                PREV_SCREEN_SIZE.width  = CURRENT_SCREEN_SIZE.width;
                PREV_SCREEN_SIZE.height = CURRENT_SCREEN_SIZE.height;
            }

            // Update current screen info.
            CURRENT_SCREEN_SIZE.width  = width;
            CURRENT_SCREEN_SIZE.height = height;

            // Do callback.
            if (onScreenResize != null)
            {
                onScreenResize.Invoke();
            }
        }