public override void OnGUI(Rect position, int column)
            {
                if (column == 0)
                {
                    GUI.Box(HeEditorGUI.SpaceL(ref position, position.height), HeEditorStyles.csImage, HeEditorStyles.iconStyle);

                    //if (m_managedObject.gcHandlesArrayIndex != -1)
                    //{
                    //    if (HeEditorGUI.GCHandleButton(HeEditorGUI.SpaceR(ref position, position.height)))
                    //    {
                    //        m_owner.m_Window.OnGoto(new GotoCommand(new RichGCHandle(m_snapshot, m_snapshot.gcHandles[m_managedObject.gcHandlesArrayIndex])));
                    //    }
                    //}

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

                switch ((Column)column)
                {
                case Column.Type:
                    HeEditorGUI.TypeName(position, typeName);
                    break;

                case Column.CppCounterpart:
                    if (m_Object.nativeObject.isValid)
                    {
                        GUI.Label(position, m_Object.nativeObject.name);
                    }
                    break;

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

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

                case Column.Assembly:
                    GUI.Label(position, assembly);
                    break;
                }
            }
Beispiel #2
0
            public override void OnGUI(Rect position, int column)
            {
                switch ((Column)column)
                {
                case Column.Address:
                    HeEditorGUI.Address(position, address);
                    break;

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

#if HEAPEXPLORER_DISPLAY_REFS
                case Column.Refs:
                    GUI.Label(position, refs.ToString());
                    break;
#endif
                }
            }
Beispiel #3
0
            public override void OnGUI(Rect position, int column)
            {
                switch ((Column)column)
                {
                case Column.Type:
                    HeEditorGUI.TypeName(position, displayName, m_Tooltip);
                    break;

                case Column.Name:
                    EditorGUI.LabelField(position, m_Value);
                    break;

                case Column.Address:
                    if (address != 0)     // statics dont have an address in PackedMemorySnapshot and I don't want to display a misleading 0
                    {
                        HeEditorGUI.Address(position, address);
                    }
                    break;
                }
            }
Beispiel #4
0
            public override void OnGUI(Rect position, int column)
            {
                if (column == 0 && depth == 0)
                {
                    switch (rootPath.reason)
                    {
                    case RootPathReason.Static:
                    case RootPathReason.DontDestroyOnLoad:
                    case RootPathReason.DontUnloadUnusedAsset:
                    case RootPathReason.UnityManager:
                        GUI.Box(HeEditorGUI.SpaceL(ref position, position.height), new GUIContent(HeEditorStyles.warnImage, rootPath.reasonString), HeEditorStyles.iconStyle);
                        break;
                    }
                }

                switch ((Column)column)
                {
                case Column.Type:
                    HeEditorGUI.TypeName(position, displayName);
                    break;

                case Column.Name:
                    EditorGUI.LabelField(position, m_Value);
                    break;

                case Column.Address:
                    if (m_Address != 0)     // statics dont have an address in PackedMemorySnapshot and I don't want to display a misleading 0
                    {
                        HeEditorGUI.Address(position, m_Address);
                    }
                    break;

                case Column.Depth:
                    if (rootPath != null)
                    {
                        EditorGUI.LabelField(position, rootPath.count.ToString());
                    }
                    break;
                }
            }
Beispiel #5
0
            public override void OnGUI(Rect position, int column)
            {
                if (column == 0)
                {
                    GUI.Box(HeEditorGUI.SpaceL(ref position, position.height), HeEditorStyles.gcHandleImage, HeEditorStyles.iconStyle);

                    if (m_GCHandle.nativeObject.isValid)
                    {
                        if (HeEditorGUI.CppButton(HeEditorGUI.SpaceR(ref position, position.height)))
                        {
                            m_Owner.window.OnGoto(new GotoCommand(m_GCHandle.nativeObject));
                        }
                    }

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

                switch ((Column)column)
                {
                case Column.GCHandle:
                    HeEditorGUI.TypeName(position, typeName);
                    break;

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

                case Column.Address:
                    HeEditorGUI.Address(position, address);
                    break;
                }
            }
Beispiel #6
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
                }
            }