How to make a singleton asset

Is there any way to create a singleton asset? What I want is to have a global asset, that there will only be 1 instance of, and that I will use globally across multiple classes. For example, I wait to have an asset where I can input potential names for my items that are randomly generated, but I want all these names to be grouped in a single config file for the whole project, along with a bunch of other settings that will affect items’ behavior.

I do not want the Game singleton class, I want a singleton ASSET. Is there a way to achieve this?

Rama posted a tutorial on the wiki on how to create a singleton class. You will need some C++ knowledge for this. I hope this helps :slight_smile:


Another way would be the use of data tables. You can take a look at this video for a good introduction. This approach is more limited than the own implementation of singletons but far easier.