Skip to main content
Scripts:
  • Assets/_MolcaDT/Code/Scripts/POI/POIManager.cs
  • Assets/_MolcaDT/Code/Scripts/POI/POIFollowTarget.cs
  • Assets/_MolcaDT/Code/Scripts/Handler/Panel Handler/*

When to use

Use this page when wiring machine selection UX: screen/world POI indicators, camera follow behavior, and right/side panel detail presentation.

POI layer

POIManager is a central runtime controller:
  • Spawns/updates POIHandler UI items
  • Tracks follow targets and offscreen behavior
  • Applies overlap/stacking rules and layout padding
Common fields to tune in Inspector: poiHandlerParent, poiHandlerPrefab, offscreen mode, stacking/padding parameters.

Panel handler layer

Handlers under Handler/Panel Handler/ split machine detail concerns:
  • Overview/Data panels (OverviewPanelHandler, DataPanelHandler)
  • Working order flows (WorkingOrder*)
  • Documentation/info/config children panel handlers
These are usually orchestrated by selection handlers and manager events rather than VR step logic.

Code

Singleton + layoutPOIManager (execution order 2000) expects CameraController.instance for world→screen projection and poiHandlerParent as a RectTransform canvas area. InstantiatePOIButton spawns from poiHandlerPrefab (or an override prefab) and optional Action<POIHandler> after creation; ChangePOIButton(POIType) hides all managed cards then drives PlantManager machines’ POI mode; SelectPOIButton(List<MachineInfo>) filters selectable machines, derives POIType from LevelData, and invokes FactoryMenuManager.InvokePOIButton. Handler — Each POIHandler pairs with POIFollowTarget on the same object, resolves MachineInfo, and toggles label/overview panels. POIFollowTarget drives world anchor position; POIManager.LateUpdate runs overlap resolution when allowStacking is false.
using MolcaDT.POI;
using System.Collections;
using UnityEngine;

public class SpawnPoiCard : MonoBehaviour
{
    public void AddCard()
    {
        StartCoroutine(POIManager.instance.InstantiatePOIButton(handler =>
        {
            // Configure handler / MachineInfo on the new instance
        }));
    }
}
using MolcaDT.Handler;
using MolcaDT.POI;
using System.Collections.Generic;

public static class PoiMode
{
    public static void ShowOverviewFor(List<MachineInfo> machines) =>
        POIManager.instance.SelectPOIButton(machines);

    public static void SetGlobalPoiType(POIType type) =>
        POIManager.instance.ChangePOIButton(type);
}

Troubleshooting

  • Null ref in POIManager.AwakeCameraController.instance and poiHandlerParent must exist in the loaded scene; POI manager typically lives under the same UI hierarchy as the twin camera rig.
  • POIs not visible — Confirm POIFollowTarget components are active, MachineInfo / ObjectReference wiring matches selection flow, and canvas render mode works with CameraController’s camera.
  • Heavy overlap or jitter — Increase itemPadding, resolveIterations, or enable allowStacking; switch cardOffscreenMode between ClampToCanvasEdges and HideWhenOffscreen per UX.
  • Overview empty — Same as mapping: network layer must deliver ParameterDatum lists into OverviewPanelHandler / DataPanelHandler after MachineInfo selection.
  • Duplicate POIManager — Second instance **Destroy**s itself; keep a single manager in the DT bootstrap scene.