public Enumerator(SpawnPool pool) { if (pool == null) { throw new System.ArgumentNullException("pool"); } _e = pool._registeredPrefabs.GetEnumerator(); }
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; } }
protected override void OnDestroy() { base.OnDestroy(); Pools.RemoveReference(this); if (Object.ReferenceEquals(this, _defaultPool)) { _defaultPool = null; } }
public static void CreatePrimaryPool() { if (PrimaryPoolExists) { return; } var go = new GameObject(DEFAULT_SPAWNPOOL_NAME); _defaultPool = go.AddComponent <SpawnPool>(); }
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(); } }
internal void DeInit() { _pool = null; _prefab = null; _sCacheName = null; }
/// <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; }
internal void Init(SpawnPool pool, GameObject prefab) { _pool = pool; _prefab = prefab; _sCacheName = null; }
internal 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="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; }
internal void Init(SpawnPool pool, int prefabId) { _pool = pool; _prefabId = prefabId; _sCacheName = null; }
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; }