I have kind of a basic and maybe stupid question, I’ve been trying to figure out for a few days for how to layout my code. I have a simple script a Random Name Generator, this will be a single instance that is only used very infrequently, only when objects are created which may not be very often at all. Do I place it on a random empty game object in the scene(a game manager object)? What happens if I change scene and forget to put it back in and wont it just be sitting there memory wasting resources for the majority of the time.
I’ve looked around for loads of information at first singletons seemed good, but then I looked further and I heard other’s saying singletons are bad. They can end up with some similar problems where you have dependencies conflicts and bugs. I then saw Scriptable objects as a method that seems to work better than Singletons, but then I looked further and doesn’t ECS sort of replace this. So I’m kind of confused.
So what is the best method to have access to a single instance script so its not wasting resources but is accessible by other scripts at any time?