Detailed Method Reference
Namespace: Canley.Utility.CSV.Standard
Interface: ICSVDisplayable<T>
Display
void Display(T record)-
Description: The mandatory implementation contract triggered automatically by the
CSVTable<T>.SpawnUImethod for every record in the processed list. -
Workflow:
- Invocation:
SpawnUIinstantiates the designated UI prefab for each record and automatically invokes this method on components implementing the interface. - Data Binding: Receives the strongly-typed
CSVRecordinstance (T), allowing developers to map live fields or shadow dictionary values directly to local UI components.
- Invocation:
-
Parameters:
record: The strongly-typed scriptable object record instance containing the current row’s data.
-
Returns:
void -
Example:
public class ShopSlotUI : MonoBehaviour, ICSVDisplayable<ShopItem>
{
public Text nameText;
public Text priceText;
/// <summary>
/// Binds the shop record data directly to local UI text components.
/// </summary>
public void Display(ShopItem record)
{
nameText.text = record.itemName;
priceText.text = $"${record.price}";
}
}TIP
Keep your
Displayimplementation focused purely on UI updates and local event binding. Any complex game logic or purchase requests triggered from the UI should be passed up to a manager class rather than handled directly inside this method.