예제 #1
0
        void Init()
        {
            var    editors      = PopulateCache();
            Object editorTarget = editor.targets[0];
            string editorTitle  = ObjectNames.GetInspectorTitle(editorTarget);

            var inspectorElementMode = InspectorElement.GetModeFromInspectorMode(inspectorWindow.inspectorMode);

            if (inspectorWindow.useUIElementsDefaultInspector)
            {
                inspectorElementMode &= ~(InspectorElement.Mode.IMGUIDefault);
            }

            m_InspectorElement = new InspectorElement(editor, inspectorElementMode)
            {
                focusable = false
            };


            m_Header = BuildHeaderElement(editorTitle);
            m_Footer = BuildFooterElement(editorTitle);

            m_InspectorElement.name = editorTitle + "Inspector";
            m_InspectorElement.style.paddingBottom = InspectorWindow.kEditorElementPaddingBottom;

            if (EditorNeedsVerticalOffset(editors, editorTarget))
            {
                m_InspectorElement.style.overflow = Overflow.Hidden;
            }

            UpdateInspectorVisibility();
        }
예제 #2
0
        void Init()
        {
            var    editors      = PopulateCache();
            Object editorTarget = editor.targets[0];
            string editorTitle  = ObjectNames.GetInspectorTitle(editorTarget);

            var inspectorElementMode = InspectorElement.GetModeFromInspectorMode(inspectorWindow.inspectorMode);

            if (inspectorWindow.useUIElementsDefaultInspector)
            {
                inspectorElementMode &= ~(InspectorElement.Mode.IMGUIDefault);
            }

            m_InspectorElement = new InspectorElement(editor, inspectorElementMode)
            {
                focusable = false
            };


            m_Header = BuildHeaderElement(editorTitle);
            m_Footer = BuildFooterElement(editorTitle);

            m_InspectorElement.name = editorTitle + "Inspector";
            m_InspectorElement.style.paddingBottom = InspectorWindow.kEditorElementPaddingBottom;

            if (EditorNeedsVerticalOffset(editors, editorTarget))
            {
                m_InspectorElement.style.overflow = Overflow.Hidden;
            }

            UpdateInspectorVisibility();

            Add(m_Header);
            // If the editor targets contain many target and the multi editing is not supported, we should not add this inspector.
            // However, the header and footer are kept since these are showing information regarding this state.
            if ((editor.targets.Length <= 1) || (inspectorWindow.IsMultiEditingSupported(editor, editor.target)))
            {
                Add(m_InspectorElement);
            }

            Add(m_Footer);
        }
예제 #3
0
        InspectorElement BuildInspectorElement()
        {
            var editors     = PopulateCache();
            var editorTitle = ObjectNames.GetInspectorTitle(m_EditorTarget);

            InspectorElement.Mode inspectorElementMode;

            var propertyEditor = inspectorWindow as PropertyEditor;

            if (null == propertyEditor || propertyEditor.inspectorElementModeOverride == 0)
            {
                inspectorElementMode = InspectorElement.GetModeFromInspectorMode(inspectorWindow.inspectorMode);

                if (inspectorWindow.useUIElementsDefaultInspector)
                {
                    inspectorElementMode &= ~(InspectorElement.Mode.IMGUIDefault);
                }
            }
            else
            {
                inspectorElementMode = (InspectorElement.Mode)propertyEditor.inspectorElementModeOverride;
            }

            var inspectorElement = new InspectorElement(editor, inspectorElementMode)
            {
                focusable = false,
                name      = editorTitle + "Inspector",
                style     =
                {
                    paddingBottom = PropertyEditor.kEditorElementPaddingBottom
                }
            };

            if (EditorNeedsVerticalOffset(editors, m_EditorTarget))
            {
                inspectorElement.style.overflow = Overflow.Hidden;
            }

            return(inspectorElement);
        }