Object Catalog 3D (Scrollable + Search, real prefabs) ===================================================== This provides a scrollable catalog where each item shows the actual 3D prefab instance (not a thumbnail), with a label below and an Inspect button that loads the inspection scene using your existing scripts (InspectableComponent, ComponentInspectionSceneLoader, ZoomCamera, etc.). Scripts ------- - ObjectCatalog3DManager.cs — builds the list from Resources paths and wires search. - ObjectItem3DUI.cs — spawns the prefab, fits it inside the cell, sets up label/button. Setup ----- 1) Canvas & Scroll: - Use a Canvas set to Screen Space - Camera or World Space (not Overlay) so MeshRenderers can render with the UI. Add an EventSystem. - Create a UI > Scroll View. On `Content`, add GridLayoutGroup (or VerticalLayoutGroup) + ContentSizeFitter for automatic sizing. 2) Item prefab: - Create a UI > Panel (e.g., 250x250). Inside it: * Empty child `ModelAnchor` (Transform) where the 3D will spawn. * UI > Text `Label` anchored bottom-center. * UI > Button `InspectButton` below or overlay. - Add component `FabCity.UI.ObjectItem3DUI` to the root and assign: * `modelAnchor` → the empty anchor * `nameText` → Label * `inspectButton` → InspectButton 3) Manager: - Create an empty GO (ObjectCatalog3D) and add `FabCity.UI.ObjectCatalog3DManager`. - Assign `contentRoot` → Scroll View > Viewport > Content. - Assign `itemPrefab` → the item prefab above. - Assign `searchField` → your InputField. - Data source: * Option A: Enable `loadFromResourcesFolder` and set `resourcesFolder` (e.g., `Prefabs/Components`). The manager loads all prefabs in that folder. * Option B: Fill `entries` with individual `resourcePath` values. 4) Inspection flow (already in your project): - Each spawned item has/gets an `InspectableComponent` attached and its `prefabResourcePath` set to the entry path. Clicking the Inspect button calls `InspecionarComponente()`, which: • Stores the path into `ComponentInspectionBus` • Loads the `InspecaoComponente` scene - In the inspection scene, `ComponentInspectionSceneLoader` reads the bus, instantiates the prefab, and frames it. Your `ComponentDragRotate` and `ZoomCamera` handle interaction. Notes & Limitations ------------------- * UI Masking: Unity's `ScrollRect` mask only clips UI Graphics. Real 3D meshes won't be clipped by the viewport mask. If you need hard clipping inside the scroll view, you must either: - Use thumbnail RenderTextures (not desired here), or - Implement per-item cameras with `Camera.rect` synced to on-screen rects, or - Use a custom stencil-based shader for the 3D layer and a mask volume. If soft overflow is acceptable, the current setup works well. * Layers: Optionally put catalog models on a dedicated layer and ensure the Canvas camera renders that layer. * Scaling: Adjust `targetMaxSize` and `padding` on `ObjectItem3DUI` to fit your visuals.