Ejemplo n.º 1
0
        /// <summary>
        /// Sets the static reference and builds the pool.
        /// </summary>
        private void Awake()
        {
            pool = this;

            PopulatePool();
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Finds an instance of me in the scene, if one doesn't exist, then create one.
        /// </summary>
        private static void FindPoolInScene()
        {
            pool = FindObjectOfType(typeof(ShardPool)) as ShardPool;

            if(pool == null)
            {
                GameObject newPool = new GameObject("_Shard Pool");
                pool = newPool.AddComponent<ShardPool>();
            }
        }