Skip to content

Game.UI.Menu.StandaloneAssetUploadPanelUISystem

Assembly:
Game (assembly not explicitly present in file; typical in-game assembly)

Namespace:
Game.UI.Menu

Type:
class

Base:
UISystemBase

Summary:
A UI system that hosts a standalone asset upload panel. This system wraps and controls an internal AssetUploadPanelUISystem instance, providing widget bindings and a visibility binding so the upload panel can be shown as a standalone UI panel. It hooks and unhooks child widget change callbacks, enables/disables the underlying panel system, and updates widget and visibility bindings used by the UI layer.


Fields

  • private static readonly string kGroup
    Holds the binding group name ("assetUploadPanel") used for WidgetBindings, ValueBinding and TriggerBinding keys.

  • private AssetUploadPanelUISystem m_AssetUploadPanelUISystem
    Reference to the internal AssetUploadPanelUISystem that actually implements the upload panel behavior. This is created/retrieved in OnCreate and enabled/disabled when showing/closing the standalone panel.

  • private WidgetBindings m_WidgetBindings
    WidgetBindings instance used to expose the panel's child widgets to the UI binding system. Its children are updated when the underlying panel's children change or when the panel is closed.

  • private ValueBinding<bool> m_Visible
    A value binding that exposes the visibility state of the standalone panel (true when shown, false when closed). Updated when Show and OnClose are invoked.

Properties

  • This type has no public properties.

Constructors

  • public StandaloneAssetUploadPanelUISystem()
    Default constructor. Marked with [Preserve] attribute in source; standard parameterless constructor that allows the system to be created/managed by the world.

Methods

  • protected override void OnCreate()
    Initializes the system: obtains or creates the AssetUploadPanelUISystem, disables it by default, sets up WidgetBindings for the "assetUploadPanel" group, adds editor widget bindings, creates and adds the visibility ValueBinding, and registers a close TriggerBinding that calls OnClose.

  • public void Show(AssetData mainAsset, bool allowManualFileCopy = true)
    Shows the standalone asset upload panel for the provided mainAsset. Steps performed:

  • Calls Show on the underlying AssetUploadPanelUISystem with the allowManualFileCopy flag.
  • Ensures the system's onChildrenChange delegate is set to OnChildrenChange (removes any previous registration, then adds this handler).
  • Enables the underlying AssetUploadPanelUISystem.
  • Updates m_WidgetBindings.children to the panel's current children.
  • Sets m_Visible to true.

  • private void OnClose()
    Called when the UI close trigger is activated. If the underlying AssetUploadPanelUISystem.Close() returns true (panel closed), this method:

  • Unregisters the OnChildrenChange handler from the underlying system.
  • Disables the underlying AssetUploadPanelUISystem.
  • Clears m_WidgetBindings.children (sets to an empty array).
  • Updates m_Visible to false.

  • private void OnChildrenChange(IList<IWidget> children)
    Callback invoked when the underlying AssetUploadPanelUISystem reports child widget changes. Updates m_WidgetBindings.children to reflect the new child list.

Usage Example

// Typical usage from game code or another system:
var standalone = world.GetOrCreateSystemManaged<StandaloneAssetUploadPanelUISystem>();

// Show the upload panel for an asset (allowManualFileCopy is optional and defaults to true)
standalone.Show(mainAsset, allowManualFileCopy: true);

// The panel's close button is wired to the "close" TriggerBinding; when activated the panel will close
// and internal bindings will be cleaned up automatically.

Additional notes: - The system relies on the underlying AssetUploadPanelUISystem for most UI behavior; this class primarily manages lifecycle and bindings for a standalone display. - Methods and constructor are marked with [Preserve] in source to avoid stripping by the engine's code stripping tools.