Пример #1
0
        public static EditorWindow CreateWindow(PackedMemorySnapshot snapshot, AbstractMemoryReader memoryReader, System.UInt64 address, PackedManagedType type)
        {
            var visualizer = AbstractDataVisualizer.CreateVisualizer(type.name);

            if (visualizer == null)
            {
                Debug.LogWarningFormat("Could not create DataVisualizer for type '{0}'", type.name);
                return(null);
            }
            visualizer.Initialize(snapshot, memoryReader, address, type);

            var window = DataVisualizerWindow.CreateInstance <DataVisualizerWindow>();

            window.SetVisualizer(visualizer);
            window.ShowUtility();
            return(window);
        }
Пример #2
0
        void TryDrawDataVisualizerButton(PropertyGridItem itm, ref Rect rect)
        {
            if (!enabled || type.managedTypesArrayIndex == -1)
            {
                return;
            }

            if (!AbstractDataVisualizer.HasVisualizer(type.name))
            {
                return;
            }

            if (GUI.Button(HeEditorGUI.SpaceR(ref rect, rect.height), new GUIContent("", "Show in Data Visualizer."), HeEditorStyles.dataVisualizer))
            {
                var pointer = address;
                if (type.isPointer)
                {
                    pointer = myMemoryReader.ReadPointer(address);
                }

                DataVisualizerWindow.CreateWindow(m_Snapshot, myMemoryReader, pointer, type);
            }
        }