Oh c’mon, not again
• It’s global
• Coupling, coupling, coupling
• Concurrency (not in Unity though)
Perfect usage example:
• Avoided singleton
• Just remove it (if possible)
• Subclass Sandbox
• Service Locator
Some Stuff To Handle
• Scene transitions – ensure there is only
one GO that was created first
• Ensure there is no chance of multiple
instances in scene
Perfect Unity Singleton
• State that “travels” through all scenes
and needs to be a gameObject
• Generic MonoSingleton concept
• Built-in Instantiate method. Creates
identical copy of the provided
• Prototype Implementation example
• All about efficiency (Similar to
• Flyweight objects can represent states
in state patterns.
• FSM Concept
• Mecanim Animator is an FSM
Finite state machines are useful when:
• You have an entity whose behavior changes based on some
• That state can be rigidly divided into one of a relatively small
number of distinct options.
• The entity responds to a series of inputs or events over time.
5. Subclass Sandbox
Define behavior in a subclass
using a set of operations provided
by its base class.
6. Type Object
Define a type object class and a typed
Each type object instance represents a
different logical type. Each typed object
stores a reference to the type object that
describes its type.
When to use?
• You don’t know what types you
will need up front.
• Need to modify and add types
• Asset files and custom editors –
perfect for game designers
7. Object Pool
Just a collection of reusable