public void DisplayInspector()
        {
            if (_alignedButtonStyle == null)
            {
                _alignedButtonStyle = new GUIStyle(GUI.skin.button)
                {
                    alignment = TextAnchor.MiddleLeft,
                    wordWrap  = true
                };
            }

            if (Event.current.isKey && Event.current.keyCode == KeyCode.Return)
            {
                _userHasHitReturn = true;
            }

            while (_inspectorStack.Count > 0 && !_inspectorStack.Peek().EntryIsValid())
            {
                var se = _inspectorStack.Pop();
                RuntimeUnityEditorCore.Logger.Log(LogLevel.Message, $"[Inspector] Removed invalid/removed stack object: \"{se.Name}\"");
            }

            if (_inspectorStack.Count != 0)
            {
                _inspectorWindowRect = GUILayout.Window(_windowId, _inspectorWindowRect, InspectorWindow, "Inspector");
                InterfaceMaker.EatInputInRect(_inspectorWindowRect);
            }
        }
Example #2
0
        public void DisplayInspector()
        {
            if (!Show)
            {
                return;
            }

            if (Event.current.isKey && (Event.current.keyCode == KeyCode.Return || Event.current.keyCode == KeyCode.KeypadEnter))
            {
                _userHasHitReturn = true;
            }

            // Clean up dead tab contents
            foreach (var tab in _tabs.ToList())
            {
                while (tab.InspectorStack.Count > 0 && !tab.InspectorStack.Peek().EntryIsValid())
                {
                    RuntimeUnityEditorCore.Logger.Log(LogLevel.Message, $"[Inspector] Removed invalid/removed stack object: \"{tab.InspectorStack.Peek().Name}\"");
                    tab.Pop();
                }

                if (tab.InspectorStack.Count == 0)
                {
                    RemoveTab(tab);
                }
            }

            _inspectorWindowRect = GUILayout.Window(_windowId, _inspectorWindowRect, InspectorWindow, "Inspector");
            InterfaceMaker.EatInputInRect(_inspectorWindowRect);
        }
Example #3
0
        public void DisplayWindow()
        {
            if (_completionsListingStyle == null)
            {
                _completionsListingStyle = new GUIStyle(GUI.skin.button)
                {
                    border  = new RectOffset(0, 0, 0, 0),
                    margin  = new RectOffset(0, 0, 0, 0),
                    padding = new RectOffset(0, 0, 0, 0),
                    hover   = { background = Texture2D.whiteTexture, textColor = Color.black },
                    normal  = { background = null },
                    focused = { background = Texture2D.whiteTexture, textColor = Color.black },
                    active  = { background = Texture2D.whiteTexture, textColor = Color.black }
                };
            }

            _windowRect = GUILayout.Window(_windowId, _windowRect, WindowFunc, "C# REPL Console");
            InterfaceMaker.EatInputInRect(_windowRect);
        }