> ## Documentation Index
> Fetch the complete documentation index at: https://docs-unity.molca.id/llms.txt
> Use this file to discover all available pages before exploring further.

# Factory menu & navigation

> FactoryMenuManager, sidebar/footer panels, popup panels, and menu bar buttons.

**Namespace:** `MolcaDT.Managers`\
**File:** `Assets/_MolcaDT/Code/Scripts/Managers/FactoryMenuManager.cs`

The factory menu system provides the main navigation shell for DT twin applications: footer bar, left sidebar, popup panels, and menu bar icon management.

## FactoryMenuManager

Singleton (`instance`) that orchestrates the entire menu UI. Initializes in `Awake` with `DefaultExecutionOrder(-100)`, discovers popup panels, and wires animation states.

### Inspector

| Field               | Type                            | Purpose                                  |
| ------------------- | ------------------------------- | ---------------------------------------- |
| `footerPanel`       | `GameObject`                    | Bottom navigation bar                    |
| `leftSidebarPanel`  | `GameObject`                    | Left sidebar info panel                  |
| `idleColor`         | `ColorIDReference`              | Button color when not selected           |
| `selectedColor`     | `ColorIDReference`              | Button color when selected               |
| `popupSpawnParent`  | `Transform`                     | Shared parent for popup panels           |
| `popupBlockerLayer` | `RectTransform`                 | Fullscreen dismiss layer for open popups |
| `menuBarIconKeys`   | `FactoryMenuBarIconKeyMappings` | Maps bundle settings to icon keys        |
| `notificationPanel` | `GameObject`                    | Notification panel reference             |
| `cctvAccessPanel`   | `GameObject`                    | CCTV access panel reference              |

### Public API

#### Navigation controls

| Method                    | Signature                                   | Description                              |
| ------------------------- | ------------------------------------------- | ---------------------------------------- |
| `ToggleFooterPanel`       | `void ToggleFooterPanel()`                  | Toggle the bottom footer bar open/closed |
| `ToggleSidebarInfoPanel`  | `void ToggleSidebarInfoPanel()`             | Toggle the left sidebar info panel       |
| `SetupLeftSidebarPanel`   | `void SetupLeftSidebarPanel(bool isActive)` | Show or hide the left sidebar            |
| `ToggleNotificationPanel` | `void ToggleNotificationPanel()`            | Toggle the notification panel            |
| `ToggleCCTVAccessPanel`   | `void ToggleCCTVAccessPanel()`              | Toggle the CCTV access panel             |

#### Menu bar operations

| Method                         | Signature                                           | Description                                            |
| ------------------------------ | --------------------------------------------------- | ------------------------------------------------------ |
| `InvokeMenuBarOptionByIconKey` | `void InvokeMenuBarOptionByIconKey(string iconKey)` | Activate a menu bar option by its icon key             |
| `SyncMenuBarFromActiveBundle`  | `void SyncMenuBarFromActiveBundle()`                | Sync menu bar icons from the active AssetBundle config |
| `SetupIcon`                    | `void SetupIcon(string iconKey)`                    | Set the active icon state for a menu bar button        |

#### Popup panels

| Method                      | Signature                                                   | Description                                       |
| --------------------------- | ----------------------------------------------------------- | ------------------------------------------------- |
| `TogglePopUpPanel`          | `void TogglePopUpPanel(string key)`                         | Open or close a popup panel by key                |
| `OpenPopUpPanelForPanel`    | `void OpenPopUpPanelForPanel(FactoryMenuPopUpPanel panel)`  | Open a specific popup panel instance              |
| `ClosePopUpPanelForPanel`   | `void ClosePopUpPanelForPanel(FactoryMenuPopUpPanel panel)` | Close a specific popup panel instance             |
| `ResetAllPopUpPanelsToIdle` | `void ResetAllPopUpPanelsToIdle()`                          | Reset all popup panels to their idle/closed state |
| `SetPopUpBlockerEnabled`    | `void SetPopUpBlockerEnabled(bool enabled)`                 | Enable/disable the fullscreen dismiss layer       |

#### Quick-access invokers

| Method                                       | Description                            |
| -------------------------------------------- | -------------------------------------- |
| `InvokeMaterialButton(int index)`            | Open material selection popup at index |
| `InvokeRoofButton(int index)`                | Toggle roof visibility at index        |
| `InvokeHighlightSafetyZoneButton(int index)` | Open safety zone highlights            |
| `InvokePOIButton(int index)`                 | Show POI (data) overlay                |

#### Camera & environment

| Method                              | Signature                                  | Description                                         |
| ----------------------------------- | ------------------------------------------ | --------------------------------------------------- |
| `ResetCamera`                       | `void ResetCamera()`                       | Reset camera to default position                    |
| `SwitchCamera`                      | `void SwitchCamera()`                      | Switch between camera presets                       |
| `SetupRoof`                         | `void SetupRoof(bool state)`               | Show/hide the roof                                  |
| `SetupMaterial`                     | `void SetupMaterial(int index)`            | Apply a building material preset                    |
| `SetupHighlightSafetyZone`          | `void SetupHighlightSafetyZone(int index)` | Set safety zone highlight mode                      |
| `SetupPOIButton`                    | `void SetupPOIButton(string poiType)`      | Set POI button type                                 |
| `RefreshFooterLayoutAfterAnimation` | `void RefreshFooterLayoutAfterAnimation()` | Recalculate footer layout after animations complete |

## FactoryMenuPopUpPanel

**File:** `Assets/_MolcaDT/Code/Scripts/Managers/FactoryMenuPopUpPanel.cs`

A single popup panel managed by `FactoryMenuManager`. Each panel has a unique key, an open/close animation, and optional content.

## FactoryMenuPopUpOptionData

**File:** `Assets/_MolcaDT/Code/Scripts/Managers/FactoryMenuPopUpOptionData.cs`

ScriptableObject holding configuration for a single popup panel option (icon, label, linked panels).

## FactoryMenuBarIconKeyMappings

**File:** `Assets/_MolcaDT/Code/Scripts/Managers/FactoryMenuBarIconKeyMappings.cs`

Maps `AssetBundleUtility` settings to menu bar icon keys for dynamic menu bar construction.

## Code

```csharp theme={null}
using MolcaDT.Managers;
using UnityEngine;

public class MenuController : MonoBehaviour
{
    public void ToggleFooter()
    {
        FactoryMenuManager.instance.ToggleFooterPanel();
    }

    public void OpenMaterials()
    {
        FactoryMenuManager.instance.InvokeMaterialButton(0);
    }

    public void OpenDataPanel()
    {
        FactoryMenuManager.instance.InvokePOIButton(0);
    }

    public void ToggleRoof()
    {
        FactoryMenuManager.instance.SetupRoof(true);
    }

    public void ResetView()
    {
        FactoryMenuManager.instance.ResetCamera();
    }
}
```

## Related

* [DT startup flow](/dt/startup-flow) — where FactoryMenuManager is initialized
* [DT POI and panels](/dt/poi-and-panels) — POI system integration
