com.amanotes.prefabpool 1.0.3 → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,21 +1,28 @@
1
1
  # Changelog
2
2
 
3
+ ## [1.1.0] - 2026-04-21
4
+
5
+ ### Added
6
+ - `IPrefabPool.MarkShutdown()` — marks pool as shut down so Get/Return calls no-op safely
7
+ - `PrefabPool.MarkShutdown()` implementation — sets `_isDestroyed = true`
8
+
3
9
  ## [1.0.3] - 2026-04-07
4
10
 
5
11
  ### Fixed
6
- - `PoolEntry.Return`: renamed pooled GameObjects back to their entry `id` in Editor for easier hierarchy debugging (`PrefabPool.cs`)
12
+ - `PoolEntry.Return` renames pooled GameObjects back to entry `id` in Editor
7
13
 
8
14
  ## [1.0.2] - 2026-04-06
9
15
 
10
16
  ### Fixed
11
- - `PoolEntry.Return`: deactivate GameObject before `SetParent` to prevent `Cannot set the parent of the GameObject while activating or deactivating the parent GameObject` error during scene shutdown
12
- - `PoolEntry.Get`: explicit `SetActive(true)` to match — objects are now consistently inactive in pool, active when in use
13
- - `PoolEntry.PreAllocate`: prewarm objects are now spawned inactive, consistent with the return state
14
- - `PrefabPool.DestroyPool`: `_customPool` (Resize<T>) entries are now properly destroyed on shutdown
15
- - `PrefabPool.Initialize`: added `_isInitializing` guard to prevent double-prewarm if called concurrently
16
- - `PoolEntry.PurgeDestroyed`: new method, called on `Register` to remove stale destroyed-object refs when a PoolGroup ScriptableObject is reused across scene loads
17
- - `PrefabPool.PurgeStaleInstanceMap`: cleans up `_instanceTypeMap` entries for externally-destroyed objects (Editor only)
17
+ - `PoolEntry.Return` deactivates before `SetParent` to prevent parent activation error
18
+ - `PoolEntry.Get` explicit `SetActive(true)` for consistent pool state
19
+ - `PoolEntry.PreAllocate` prewarm objects spawned inactive
20
+ - `PrefabPool.DestroyPool` properly destroys `_customPool` entries
21
+ - `PrefabPool.Initialize` added `_isInitializing` guard against double-prewarm
22
+ - `PoolEntry.PurgeDestroyed` removes stale refs on `Register`
23
+ - `PrefabPool.PurgeStaleInstanceMap` cleans up externally-destroyed objects (Editor only)
18
24
 
19
25
  ## [1.0.1]
20
26
 
27
+ ### Added
21
28
  - Initial release
@@ -168,6 +168,12 @@ namespace Amanotes.Core
168
168
  GameObject Get(PoolGroup group, string prefabId, Vector3 localPosition = default, Transform customParent = null);
169
169
  void Return(PoolGroup group, GameObject gameObject);
170
170
  IEnumerator Initialize();
171
+ /// <summary>
172
+ /// Marks the pool as shut down so all subsequent Get/Return calls no-op safely.
173
+ /// Call this before detaching tiles during game shutdown to prevent SetParent errors
174
+ /// when the pool's hierarchy is being deactivated.
175
+ /// </summary>
176
+ void MarkShutdown();
171
177
  }
172
178
 
173
179
  public static class PrefabPoolExtensions
@@ -308,6 +314,8 @@ namespace Amanotes.Core
308
314
 
309
315
  public bool IsReady => _isReady;
310
316
 
317
+ public void MarkShutdown() => _isDestroyed = true;
318
+
311
319
  public void RegisterGroup(PoolGroup group, Transform spawnParent)
312
320
  {
313
321
  if (group == null) return;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "com.amanotes.prefabpool",
3
- "version": "1.0.3",
4
- "displayName": "Amanotes Prefab Pool",
3
+ "version": "1.1.0",
4
+ "displayName": "[Ama] Prefab Pool",
5
5
  "description": "Generic object pooling system for Unity",
6
6
  "unity": "2022.3",
7
7
  "keywords": [