Example #1
0
        public override void OnGUI()
        {
            base.OnGUI();

            using (new EditorGUILayout.HorizontalScope())
            {
                using (new EditorGUILayout.VerticalScope())
                {
                    // Native objects list at the left side
                    using (new EditorGUILayout.VerticalScope(HeEditorStyles.panel))
                    {
                        using (new EditorGUILayout.HorizontalScope())
                        {
                            OnDrawHeader();

                            if (m_SearchField.OnToolbarGUI())
                            {
                                m_NativeObjectsControl.Search(m_SearchField.text);
                            }
                        }
                        GUILayout.Space(2);

                        m_NativeObjectsControl.OnGUI();
                    }

                    m_SplitterVert = HeEditorGUILayout.VerticalSplitter("m_splitterVert".GetHashCode(), m_SplitterVert, 0.1f, 0.8f, window);

                    using (new EditorGUILayout.HorizontalScope(GUILayout.Height(window.position.height * m_SplitterVert)))
                    {
                        m_ConnectionsView.OnGUI();
                    }
                }

                m_SplitterHorz = HeEditorGUILayout.HorizontalSplitter("m_splitterHorz".GetHashCode(), m_SplitterHorz, 0.1f, 0.8f, window);

                // Various panels at the right side
                using (new EditorGUILayout.VerticalScope(GUILayout.Width(window.position.width * m_SplitterHorz)))
                {
                    using (new EditorGUILayout.VerticalScope(HeEditorStyles.panel))
                    {
                        using (new EditorGUILayout.HorizontalScope(GUILayout.MaxWidth(16)))
                        {
                            if (m_Selected.HasValue)
                            {
                                HeEditorGUI.NativeObjectIcon(GUILayoutUtility.GetRect(16, 16), m_Selected.Value);
                                //GUI.DrawTexture(r, HeEditorStyles.assetImage);
                            }

                            EditorGUILayout.LabelField("Native UnityEngine object", EditorStyles.boldLabel);
                        }

                        GUILayout.Space(2);
                        m_NativeObjectControl.OnGUI();
                    }

                    m_PreviewSplitterVert = HeEditorGUILayout.VerticalSplitter("m_PreviewSplitterVert".GetHashCode(), m_PreviewSplitterVert, 0.1f, 0.8f, window);

                    using (new EditorGUILayout.VerticalScope(HeEditorStyles.panel, GUILayout.Height(window.position.height * m_PreviewSplitterVert)))
                    {
                        m_PreviewView.OnGUI();
                    }

                    m_RootPathSplitterVert = HeEditorGUILayout.VerticalSplitter("m_RootPathSplitterVert".GetHashCode(), m_RootPathSplitterVert, 0.1f, 0.8f, window);

                    using (new EditorGUILayout.VerticalScope(HeEditorStyles.panel, GUILayout.Height(window.position.height * m_RootPathSplitterVert)))
                    {
                        m_RootPathView.OnGUI();
                    }
                }
            }
        }
Example #2
0
            public override void OnGUI(Rect position, int column)
            {
                if (column == 0)
                {
                    HeEditorGUI.NativeObjectIcon(HeEditorGUI.SpaceL(ref position, position.height), m_Object.packed);

                    if (m_Object.managedObject.isValid)
                    {
                        if (HeEditorGUI.CsButton(HeEditorGUI.SpaceR(ref position, position.height)))
                        {
                            m_Owner.window.OnGoto(new GotoCommand(m_Object.managedObject));
                        }
                    }
                }

                switch ((Column)column)
                {
                case Column.Type:
                    GUI.Label(position, typeName);
                    break;

                case Column.Name:
                {
                    GUI.Label(position, name);

                    var e = Event.current;
                    if (e.type == EventType.ContextClick && position.Contains(e.mousePosition))
                    {
                        var menu = new GenericMenu();
                        OnShowNameContextMenu(menu);
                        if (menu.GetItemCount() > 0)
                        {
                            e.Use();
                            menu.ShowAsContext();
                        }
                    }
                }
                break;

                case Column.Size:
                    HeEditorGUI.Size(position, size);
                    break;

                case Column.Address:
                    HeEditorGUI.Address(position, address);
                    break;

                case Column.DontDestroyOnLoad:
                    GUI.Label(position, isDontDestroyOnLoad.ToString());
                    break;

                case Column.IsPersistent:
                    GUI.Label(position, isPersistent.ToString());
                    break;

                case Column.InstanceID:
                    GUI.Label(position, instanceId.ToString());
                    break;

#if HEAPEXPLORER_DISPLAY_REFS
                case Column.ReferencesCount:
                    GUI.Label(position, m_ReferencesCount.ToString());
                    break;

                case Column.ReferencedByCount:
                    GUI.Label(position, m_ReferencedByCount.ToString());
                    break;
#endif
                }
            }