Best practice sharing data between classes

For something ‘centralised’ like this, you may want to have an Items Subsystem. Then everything that wants to access Items, will access it via this Subsystem.
The Subsystem will still a reference to the Data Asset, but it’s going to only be a single reference for your entire game.

Game Instance Subsystem sounds sufficient in this case, but in many other cases, you will typically want a World Subsystem.

Additionally, depending on how many Items you have and how much data each Item consumes, you may want to consider using Data Assets instead of a Data Table for your Items. Data Assets can be streamed in and out on a per-item basis, whereas as a Data Table must be fully loaded.

1 Like