ParagonEntertainmentBanner

Displays a branded "Paragon Entertainment" banner centered in the Unity Editor's status bar. The banner is toggled via an editor preference and uses reflection-based OnGUI injection into Unity's internal AppStatusBar.

Definition

Namespace: Paragon.Editor Assembly: Paragon.Editor.dll

[InitializeOnLoad]
internal static class ParagonEntertainmentBanner

Attributes: [InitializeOnLoad] — initializes via static constructor on editor load.

Remarks

This class hooks into Unity's internal AppStatusBar window to draw a gold-colored "Paragon Entertainment" label. It uses OnGUIInjector from the LowLevel subsystem to inject a custom OnGUI callback into the status bar's draw loop.

Initialization Flow

  1. Static constructor runs on editor load ([InitializeOnLoad])

  2. Reflection finds UnityEditor.AppStatusBar type and its Repaint method

  3. EditorApplication.delayCall schedules OnEditorUpdate (status bar may not exist yet)

  4. OnEditorUpdate finds the status bar instance via Resources.FindObjectsOfTypeAll

  5. OnGUIInjector.Inject hooks the OnGUI callback into the status bar

Toggle Mechanism

The Enabled property is backed by the [EditorPreference] attribute (from ParagonSettings), persisting the toggle across editor sessions. Setting Enabled triggers a repaint of the status bar.

Quick Lookup

Goal
How

Toggle banner

Set ParagonEntertainmentBanner.Enabled (via Editor Preferences)

Banner text

" ~ Paragon Entertainment ~ "

Banner color

Gold — Color(1f, 0.843f, 0)

Banner width

180px fixed

Properties

Property
Type
Access
Description

Enabled

bool

public static

Toggles banner visibility; persisted via [EditorPreference]

Fields

Field
Type
Access
Description

statusBar

ScriptableObject

private static

Reference to Unity's internal AppStatusBar instance

appStatusBarType

Type

private static readonly

Reflected type of UnityEditor.AppStatusBar

appStatusBarRepaintMethod

MethodInfo

private static readonly

Reflected Repaint method on the status bar

enabled

bool

private static

Backing field for the Enabled property

Methods

OnEditorUpdate (private)

Finds the AppStatusBar instance and injects the OnGUI callback. Called once via EditorApplication.delayCall.

OnGUI (private)

Draws the banner label centered in the status bar area. Only draws if enabled is true.

Repaint (private)

Invokes AppStatusBar.Repaint() via reflection to refresh the status bar.

Common Pitfalls

circle-exclamation
circle-exclamation

See Also

Last updated