예제 #1
0
            public override void OnGUI(Rect position, int column)
            {
                if (column == 0)
                {
                    if (HeEditorGUI.CppButton(HeEditorGUI.SpaceL(ref position, position.height)))
                    {
                        m_Owner.window.OnGoto(new GotoCommand(m_NativeObject));
                    }

                    if (m_NativeObject.gcHandle.isValid)
                    {
                        if (HeEditorGUI.GCHandleButton(HeEditorGUI.SpaceR(ref position, position.height)))
                        {
                            m_Owner.window.OnGoto(new GotoCommand(m_NativeObject.gcHandle));
                        }
                    }

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

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

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

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

                case Column.Refs:
                    GUI.Label(position, referencesCount.ToString());
                    break;

                case Column.Assembly:
                    GUI.Label(position, assemblyName);
                    break;
                }
            }
예제 #3
0
            public override void OnGUI(Rect position, int column)
            {
                if (column == 0)
                {
                    HeEditorGUI.ManagedTypeIcon(HeEditorGUI.SpaceL(ref position, position.height), m_Type.packed);
                }

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

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

                case Column.ValueType:
                    EditorGUI.ToggleLeft(position, GUIContent.none, isValueType);
                    break;

                case Column.AssemblyName:
                    HeEditorGUI.AssemblyName(position, assemblyName);
                    break;
                }
            }
예제 #4
0
        public static void ManagedTypeIcon(Rect position, PackedManagedType type)
        {
            var isValueType = type.isValueType;
            var icon        = isValueType ? HeEditorStyles.csValueTypeImage : HeEditorStyles.csReferenceTypeImage;
            var content     = new GUIContent(icon, isValueType ? "ValueType" : "ReferenceType");

            GUI.Box(HeEditorGUI.SpaceL(ref position, position.height), content, HeEditorStyles.iconStyle);
        }
예제 #5
0
            public override void OnGUI(Rect position, int column)
            {
                if (column == 0)
                {
                    if (HeEditorGUI.CsStaticButton(HeEditorGUI.SpaceL(ref position, position.height)))
                    {
                        m_Owner.window.OnGoto(new GotoCommand(new RichStaticField(m_Snapshot, m_StaticField.staticFieldsArrayIndex)));
                    }
                }

                base.OnGUI(position, column);
            }
예제 #6
0
            public override void OnGUI(Rect position, int column)
            {
                if (column == 0)
                {
                    if (HeEditorGUI.CsButton(HeEditorGUI.SpaceL(ref position, position.height)))
                    {
                        MemoryWindow.Inspect(m_Snapshot, address, size);
                    }
                }

                base.OnGUI(position, column);
            }
            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;
                }
            }
예제 #8
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;
                }
            }
예제 #9
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;
                }
            }
            public override void OnGUI(Rect position, int column)
            {
                if (column == 0 && this.icon != null)
                {
                    GUI.Box(HeEditorGUI.SpaceL(ref position, position.height), this.icon, HeEditorStyles.iconStyle);
                }

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

                case EColumn.SizeA:
                    HeEditorGUI.Size(position, size[0]);
                    break;

                case EColumn.SizeB:
                    HeEditorGUI.Size(position, size[1]);
                    break;

                case EColumn.SizeDiff:
                    HeEditorGUI.SizeDiff(position, sizeDiff);
                    break;

                case EColumn.CountA:
                    HeEditorGUI.Count(position, count[0]);
                    break;

                case EColumn.CountB:
                    HeEditorGUI.Count(position, count[1]);
                    break;

                case EColumn.CountDiff:
                    HeEditorGUI.CountDiff(position, countDiff);
                    break;
                }
            }
예제 #11
0
        public override void OnGUI(Rect position, int column)
        {
            position.width  -= 2;
            position.x      += 1;
            position.height -= 2;
            position.y      += 1;

            //var oldcolor = GUI.color;
            //if (!enabled)
            //    GUI.color = new Color(oldcolor.r, oldcolor.g, oldcolor.b, oldcolor.a * 0.5f);

            if (column == 0 && icon != null)
            {
                GUI.Box(HeEditorGUI.SpaceL(ref position, position.height), icon, HeEditorStyles.iconStyle);
            }

            switch ((PropertyGridColumn)column)
            {
            case PropertyGridColumn.Type:
                GUI.Label(position, displayType);
                break;

            case PropertyGridColumn.Name:
                TryDrawObjectButton(this, ref position);
                GUI.Label(position, new GUIContent(displayName, tooltip));
                break;

            case PropertyGridColumn.Value:
                TryDrawDataVisualizerButton(this, ref position);
                GUI.Label(position, displayValue);
                break;
            }

            //if (!enabled)
            //    GUI.color = oldcolor;
        }
예제 #12
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
                }
            }