Example #1
0
        /// <summary>
        /// Draws the GUI elements of this window.
        /// </summary>
        /// <param name="skin">The skin this window is being drawn in.</param>
        protected override void DrawWindow(WindowSkin skin)
        {
            if (DataContext == null)
            {
                return;
            }

            if (DataContext.IsProcessingSnapshot)
            {
                DrawTools.CenterInArea(DrawProcessingLabel);
                return;
            }

            if (!DataContext.IsSnapshotAvailable)
            {
                DrawTools.CenterInArea(DrawSnapshotButton);
                return;
            }

            if (_modView is null)
            {
                var monotypeLabelStyle = new GUIStyle(skin.UnitySkin.label)
                {
                    font   = Font.CreateDynamicFontFromOSFont(Appearance.MonotypeFontNames, Appearance.FontSize),
                    margin = new RectOffset(0, 0, 2, 2),
                };

                _modView = new MonitoredModView(monotypeLabelStyle);
            }

            GUILayout.BeginVertical();
            DrawHeader();
            DrawSnapshotResults();
            GUILayout.EndVertical();
        }