1 #region Copyright Notice & License Information
35 [AddComponentMenu (
"Hydrogen/Singletons/Object Pool")]
51 static readonly System.Object _syncRoot =
new System.Object ();
65 if (_staticInstance == null) {
70 if (_staticInstance == null) {
71 var go = GameObject.Find (Hydrogen.Components.DefaultSingletonName) ??
72 new GameObject (Hydrogen.Components.DefaultSingletonName);
74 go.AddComponent<hObjectPool> ();
75 _staticInstance = go.GetComponent<hObjectPool> ();
79 return _staticInstance;
88 return _staticInstance != null;
94 protected override void Awake ()
101 DontDestroyOnLoad (gameObject);
static bool Exists()
Does an Object Pool already exist?
static hObjectPool Instance
Gets the object pool instance, creating one if none is found.
override void Awake()
Unity's Awake Event
bool Persistent
Should this object pool survive scene switches?
A drop in implementation of the Hydrogen.Core.ObjectPool. This simply makes the class an accessible s...