Skip to content

Game.UI.Editor.EditorPhotoModePanel

Assembly: Assembly-CSharp
Namespace: Game.UI.Editor

Type: class

Base: EditorPanelSystemBase

Summary:
A panel system for the in-editor Photo Mode UI. This class provides the editor panel that ties into the game's PhotoModeUISystem: it sets the panel title, exposes which widget renderer to use (PhotoMode), and activates/deactivates the PhotoModeUISystem when the panel starts and stops running. Methods and the constructor are marked with [Preserve] to avoid stripping by build/IL2CPP optimizers.


Fields

  • private PhotoModeUISystem m_PhotoModeUISystem
    Holds a reference to the PhotoModeUISystem instance for enabling/disabling the photo mode UI and any interactions required by the panel. This is resolved in OnCreate via World.GetOrCreateSystemManaged().

Properties

  • public override EditorPanelWidgetRenderer widgetRenderer => EditorPanelWidgetRenderer.PhotoMode
    Returns the widget renderer enum value used by the editor framework to choose the Photo Mode panel widget. This identifies the panel as the Photo Mode panel to the UI system.

Constructors

  • public EditorPhotoModePanel()
    Default parameterless constructor. Marked with [Preserve] to ensure it isn't removed by code-stripping.

Methods

  • protected override void OnCreate() : System.Void
    Initializes the panel. Calls base.OnCreate(), sets the localized title key ("PhotoMode.TITLE"), and resolves/stores the PhotoModeUISystem from the world:
  • title = "PhotoMode.TITLE"
  • m_PhotoModeUISystem = base.World.GetOrCreateSystemManaged()

  • protected override void OnStartRunning() : System.Void
    Called when the panel starts running. Calls base.OnStartRunning(), then activates the PhotoModeUISystem (m_PhotoModeUISystem.Activate(true)) so the photo-mode UI becomes active/visible.

  • protected override void OnStopRunning() : System.Void
    Called when the panel stops running. Calls base.OnStopRunning(), then deactivates the PhotoModeUISystem (m_PhotoModeUISystem.Activate(false)) to hide/disable the photo-mode UI.

Notes: - Methods and constructor are decorated with [Preserve] attributes in the source to prevent them being removed by the runtime/code-stripping. - title uses a localization key ("PhotoMode.TITLE"); actual displayed text will come from the game's localization tables. - The panel depends on PhotoModeUISystem being available in the World; GetOrCreateSystemManaged ensures it is created if missing.

Usage Example

[Preserve]
protected override void OnCreate()
{
    base.OnCreate();
    title = "PhotoMode.TITLE";
    m_PhotoModeUISystem = base.World.GetOrCreateSystemManaged<PhotoModeUISystem>();
}

[Preserve]
protected override void OnStartRunning()
{
    base.OnStartRunning();
    m_PhotoModeUISystem.Activate(true);
}

[Preserve]
protected override void OnStopRunning()
{
    base.OnStopRunning();
    m_PhotoModeUISystem.Activate(false);
}