Пример #1
0
        private void SetState(SXLConsoleState newState)
        {
            this.inputFix          = true;
            this.cachedCommandText = this.commandText;
            commandText            = "";

            switch (newState)
            {
            case SXLConsoleState.CLOSED:
                GUI.FocusControl(null);
                this.openTarget = 0;
                break;

            case SXLConsoleState.OPENSHORT:
                this.initialOpen = true;
                this.openTarget  = Screen.height * this.maxHeight * this.smallConsoleRatio;
                if (this.currentOpenTime > this.openTarget)
                {
                    // Prevent resizing if window vertical size is greater than small target
                    this.openTarget = 0;
                    this.state      = SXLConsoleState.CLOSED;
                    return;
                }
                this.realWindowSize   = this.openTarget;
                this.scrollPosition.y = int.MaxValue;
                break;

            case SXLConsoleState.OPENFULL:
            default:
                this.realWindowSize = Screen.height * this.maxHeight;
                this.openTarget     = this.realWindowSize;
                break;
            }
            this.state = newState;
        }
        public static IEnumerator <UnityEngine.WaitUntil> TakeDevScreenshot(string filePath, bool isMap = false)
        {
            SXLConsoleState current = SXLConsole.Instance.CurrentState;

            SXLConsole.Instance.ForceCloseConsole();
            yield return(new WaitUntil(() => SXLConsole.Instance.IsClosed == true));

            ScreenCapture.CaptureScreenshot(filePath);
            Debug.Log($"Screenshot Taken: {filePath}");

            SXLConsole.Instance.SetState(current);

            if (isMap)
            {
                LevelManager manager = LevelManager.Instance;
                manager.currentLevel.previewImage = SXLFile.LoadImageFromFile(filePath);
            }
        }
Пример #3
0
        public void ToggleState(SXLConsoleState currentState)
        {
            switch (currentState)
            {
            case SXLConsoleState.CLOSED:
                this.SetState(SXLConsoleState.OPENSHORT);
                break;

            case SXLConsoleState.OPENSHORT:
                this.SetState(SXLConsoleState.OPENFULL);
                break;

            case SXLConsoleState.OPENFULL:
            default:
                this.SetState(SXLConsoleState.CLOSED);
                break;
            }
        }