Пример #1
0
            public Enumerator(SpawnPool pool)
            {
                if (pool == null)
                {
                    throw new System.ArgumentNullException("pool");
                }

                _e = pool._registeredPrefabs.GetEnumerator();
            }
Пример #2
0
        protected override void Awake()
        {
            base.Awake();

            Pools.AddReference(this);
            if (this.CompareName(DEFAULT_SPAWNPOOL_NAME) && _defaultPool == null)
            {
                _defaultPool = this;
            }
        }
        protected override void Awake()
        {
            base.Awake();

            _pools.Add(this);
            if (this.name == DEFAULT_SPAWNPOOL_NAME && _defaultPool == null)
            {
                _defaultPool = this;
            }
        }
Пример #4
0
        protected override void OnDestroy()
        {
            base.OnDestroy();

            Pools.RemoveReference(this);
            if (Object.ReferenceEquals(this, _defaultPool))
            {
                _defaultPool = null;
            }
        }
Пример #5
0
        public static void CreatePrimaryPool()
        {
            if (PrimaryPoolExists)
            {
                return;
            }

            var go = new GameObject(DEFAULT_SPAWNPOOL_NAME);

            _defaultPool = go.AddComponent <SpawnPool>();
        }
Пример #6
0
        protected override void OnDestroy()
        {
            base.OnDestroy();

            if (object.ReferenceEquals(this, _defaultPool))
            {
                _defaultPool = null;
            }
            Pools.RemoveReference(this);

            var e = _registeredPrefabs.GetEnumerator();

            while (e.MoveNext())
            {
                e.Current.Clear();
            }
        }
Пример #7
0
 internal void DeInit()
 {
     _pool       = null;
     _prefab     = null;
     _sCacheName = null;
 }
Пример #8
0
 /// <summary>
 /// Initialize with a reference to the pool that spawned this object. Include a cache name if this gameobject is cached, otherwise no cache name should be included.
 /// </summary>
 /// <param name="pool"></param>
 /// <param name="prefab">prefab this was spawned from</param>
 /// <param name="sCacheName"></param>
 internal void Init(SpawnPool pool, GameObject prefab, string sCacheName)
 {
     _pool       = pool;
     _prefab     = prefab;
     _sCacheName = sCacheName;
 }
Пример #9
0
 internal void Init(SpawnPool pool, GameObject prefab)
 {
     _pool       = pool;
     _prefab     = prefab;
     _sCacheName = null;
 }
Пример #10
0
 internal void Init(SpawnPool owner)
 {
     _owner = owner;
 }
Пример #11
0
 /// <summary>
 /// Initialize with a reference to the pool that spawned this object. Include a cache name if this gameobject is cached, otherwise no cache name should be included.
 /// </summary>
 /// <param name="pool"></param>
 /// <param name="prefab">prefab this was spawned from</param>
 /// <param name="sCacheName"></param>
 internal void Init(SpawnPool pool, int prefabId, string sCacheName)
 {
     _pool       = pool;
     _prefabId   = prefabId;
     _sCacheName = sCacheName;
 }
Пример #12
0
 internal void Init(SpawnPool pool, int prefabId)
 {
     _pool       = pool;
     _prefabId   = prefabId;
     _sCacheName = null;
 }
Пример #13
0
 public void Init(SpawnPool owner)
 {
     _owner = owner;
 }
 /// <summary>
 /// Initialize with a reference to the pool that spawned this object. Include a cache name if this gameobject is cached, otherwise no cache name should be included.
 /// </summary>
 /// <param name="pool"></param>
 /// <param name="sCacheName"></param>
 internal void Init(SpawnPool pool, string sCacheName)
 {
     _pool       = pool;
     _sCacheName = sCacheName;
 }
 internal void Init(SpawnPool pool)
 {
     _pool       = pool;
     _sCacheName = null;
 }