Be aware of Singletons! They're actually an anti pattern and shouldn't be used. There are better ways how you can solve this problem. My two recommendations would be:
Either use a DI-Framework or use ScriptableObjects ( Scriptable Objects ).
With both then will have the benefits of:
- No direct dependency to the real implementation
- No directly link to a certain GameObject
You have a point. There are endless discussions about using singletons is good or bad.
I get the anti pattern definition, but I also think that using them in a moderated way can be benefitial.
If you're working solo and on a small project, using a singleton shouldn't cause you any trouble. It's different if you're working on large projects and as a part of a team.
I'm actually working on a small project for mobile and I'm using just 2 singleton scripts, one for game management stuff and the other one for player management stats. That's it.
They are really useful and I'm taking care of not messing with them
I think it's great to know when to use it and if it's worth it.