ICSVDisplayable
Namespace: Canley.Utility.CSV.Standard
Type: Interface
Overview
The ICSVDisplayable<T> interface acts as the contract and bridge between your data records and your user interface components. Any Unity Prefab used with the CSVTable<T>.SpawnUI method must include at least one component that implements this interface.
It decouples your data collection from your presentation layer, allowing the framework to pass records directly into your UI slots without manual assignment loops.
Method Reference
| Interface | Method (Syntax) | Description |
|---|---|---|
| ICSVDisplayable | Display(T record) | The required implementation contract triggered automatically by SpawnUI to populate visual elements. |
Key Features
- Generic Type Safety: Enforces type constraints so that your UI components only accept records matching your specific
CSVRecordsubclass. - Automated UI Spawning: Works hand-in-hand with
CSVTable<T>.SpawnUIto instantly instantiate and populate UI lists (such as inventories, shops, or quest logs). - Decoupled Architecture: Keeps your UI scripts clean by handling data presentation locally inside the target prefab.
NOTE
Ensure that any GameObject passed as a prefab parameter to
SpawnUIhas a component implementingICSVDisplayable<T>matching your table’s generic type, otherwise the framework will throw a missing component warning.