LazyValue
and singletons are two very different things.
The singleton holds and maintains a single instance of an object. Any access to that object will always result in the same object being accessed. That is the purpose of a singleton.
The LazyValue
we use only defers initialisation until first use, but it does not ensure that there is only one instance of the object. We can have many objects that are ‘lazy’.
If you were to ‘singleton’-ify a Health
component, any attempts to use that component will always give you the same component back. Even if you instantiate a new copy, the singleton pattern we use in Unity will just destroy it again (well, there are different flavours, but the one I use will). If you LazyValue
-ed a value multiple times, you will have multiple instances, each holding its respective value.
I hope this makes sense.